A spot of googling suggests that the term emerged in the 1950s, and to me it screams “euphemism, coined for marketing purposes”.
Until comparatively recently, most people in the industrialised world worked until they physically no longer could, and then they became dependants of their own adult children, a state of affairs which generally did not last too long. Retirement, in other words, was not a condition to look forward to, or to be idealised. This changed as societies became more prosperous and developed mechanisms for socialising the cost of supporting non-productive retired workers - social security, pension funds, etc - and at the same time health and life expectancy improved. For the first time retired people were identified as a class to whom you could sell things - they were a growing class and they, or enough of them, had enough spending power to make marketing goods and services to them an attractive proposition. According to this site, the term was coined in 1959 for a marketing campaign for a retirement community. I don’t know how authoritative that is, though; this site says the term was used in a marketing campaign for Merrill Lynch investments - I’m guessing, investments aimed at the retired, or those contemplating retirement. I suspect the term didn’t in fact originate in the 1950s, but it was greatly popularised then by those who wanted to sell stuff to retirees, and who needed positive images and connotations to do so.
One of Laura Ingalls Wilders Little House on the Prairie novels in fact carries the title These Happy Golden Years. It deals with the protagonist’s late adolescence, courtship and marriage. It was published in 1943. Presumably, Wilder didn’t expect the title to suggest old age to her readers. So it’s possible the term existed to describe any particularly felicitous period in somebody’s life, and only later became specific to retirement years due to the efforts of Madison Avenue.