Many books that are read today frequently use long sentences, far surpassing the 25 word limit. There is pleasure in reading such sentences, and there is pleasure in comprehending them. But oftentimes style guides tell us to limit our sentences to 25 words or less, a principle that is applied especially to informative prose and fiction. Should we always abide by this rule? And is it true that only short sentences are easy to comprehend?
No, you should not always abide by this rule.
However it depends on what type of writing you are doing. If you are writing instructions that need to be understood by people with a wide range of reading skills, this might be a good idea. The UK government website adopts this policy. It needs to communicate clearly with people who have learning differences, dyslexia, English as an additional language. It also needs to be easily understood by people who are busy, frustrated, looking for loopholes or dislike reading. Keeping sentences short helps increase readiblity.
But if you are writing a novel, or if you want to explore the complexities of a character's internal thoughts, then there is no limit on the number of words in a sentence. If you are writing a complex report for a PhD, you might need longer sentences. You should be aware that longer sentences will slow your readers down, and even exclude some of them. It's your choice.
Remember that if you are required to conform to a style guide, then you must stick to this rule. And if you are working to a style guide, even though not required, you should only break the rule purposefully and with your eyes open.