God gave us our memories so that we might have roses in December.

J. M. Barrie (1860-1937) Scottish novelist and dramatist [James Matthew Barrie]
(Misattributed)

Barrie certainly popularized the quotation -- to the extent that everyone attributes it to him. But review his actually use of the phrase in his Rectoral Address, "Courage," at the University of St. Andrews, Scotland (1922-05-03):

You have had many rectors here in St. Andrews who will continue in bloom long after the lowly ones such as I am are dead and rotten and forgotten. They are the roses in December; you remember someone said that God gave us memory so that we might have roses in December. But I do not envy the great ones. In my experience -- and you may find in the end it is yours also -- the people I have cared for most and who have seemed most worth caring for -- my December roses -- have been very simple folk.

Barrie himself credits the quotation to "someone said," and trusts that it is familiar enough that others will recognize the reference.

It appears that Barrie is paraphrasing another popular saying of the time, also generally attributed to "someone said" or "Anonymous":

Memory was given to mortals that they might have roses in December.
[Source (1920), Source (1905), Source (1902), Source (1900)]

In short, Barrie originated the popular phrasing of the quotation, but the link between gift of "memory" and "roses in December" predates him (as he acknowledges).