It's apparently not Winston Churchill. At least, there's no record of him having said or written it. And Churchill scholars point out that he was a conservative at 15 and a liberal at 35.
Indeed, it seems the origins of the comments may be French, rather than English. The Quote Investigator website writes:
The earliest evidence located by QI appeared in an 1875 French book of contemporary biographical portraits by Jules Claretie. A section about a prominent jurist and academic named Anselme Polycarpe Batbie included the following passage [translated as] ...
"Mr. Batbie, in a much-celebrated letter, once quoted the Burke paradox in order to account for his bizarre political shifts: “He who is not a républicain at twenty compels one to doubt the generosity of his heart; but he who, after thirty, persists, compels one to doubt the soundness of his mind.”Quote Investigator has not found an actual record of Mr. Batbie's "much-celebrated letter." And although the "Burke paradox" seems mostly likely to apply to Edmund Burke, it isn't clear whether it's a reference to something not-yet-discovered that was written by Burke, or by a reference to a pattern purportedly revealed by Burke's life and writings.
But hearkening back to Burke is interesting, because in Thomas Jefferson's journals one finds an entry relevant to this subject for January 1799. John Adams is president at this time. Jefferson writes:
"In a conversation between Dr. Ewen and the President, the former said one of his sons was an aristocrat, the other a democrat. The President asked if it was not the youngest who was the democrat. Yes, said Ewen. Well, said the President, a boy of 15 who is not a democrat is good for nothing, and he is no better who is a democrat at 20. Ewen told Hurt, and Hurt told me."
For a lengthy list of other places where something similar to this quotation has appeared, see here or here. While the quotation clearly has staying power, it seems overly facile to me. The distinction that liberals feel and conservatives think is silly and shallow, and shows little understanding of either. The strong beliefs of young people are easily dismissed as rooted only in feelings, but at least young people often show some flexibility about learning and adapting. It often seems the strong feelings of the middle aged and elderly are often based as much on being set in their ways and confirmation bias, and about lessons learned in the rather-different past, rather than seeking to apply some deeper weighing of facts, values, and experience.
Herbert Stein, who was an economist in many positions in Washington, DC for more than 50 years, captured some of my own sense here in his 1995 collection of essays, On the Other Hand - Essays on Economics, Economists, and Politics (from pp. 1-2):
"An old saying goes that whoever is not a Socialist when young has no heart and whoever is still a Socialist when old has no head. I would say that whoever is not a liberal when young has no heart, whoever is not a conservative when middle-aged has no head, and whoever is still either a liberal or a conservative at age seventy-eight has no sense of humor. Obviously, orthodox certainty on matters about which there can be so little certitude must eventually be seen as only amusing."If you can't learn from both liberals and conservatives, and also laugh at both liberals and conservatives, you might want to reconsider the vehemence of your partisan commitments.