(Photo by iStock)

Retiring at 55 and spending the rest of your life relaxing on the front porch may sound appealing, but if you want your brain to keep working, it’s probably not a good idea. Mounting evidence shows that staying in the workforce into old age is good not only for our bank accounts, but also for our health and mental acuity.

That’s great news for Americans, who keep working further into old age on average than Europeans, and who will be retiring even later than previously, thanks to changes built in to Social Security benefits.

As medical advances extend the length of the human lifespan — and the number of healthy, active years — scientists, economists and policymakers are delving into the question of what the optimial time to stop working is.

One message is becoming clear: don’t stop too soon.

“Retiring too early can hurt you,” said Esteban Calvo, a sociologist with the Columbia Aging Center and the Institute of Public Policy at Diego Portales University in Chile. He is currently conducting a longitudinal study looking at over 100,000 people in 21 countries to determine the physical and mental effects of retirement.

So far, the study, “Should I Stay or Should I Go?” shows negative effects for those who retire earlier than the mean age - and the outcomes are worse the earlier you stop working. “At 50 it will be very, very bad for your health,” Calvo said. “At 60 it will be bad but not as bad as at age 50.”

The study has so far looked at overall health, chronic diseases, ability to perform daily activities and happiness levels, and will look at cognitive functioning, telomere shortening, grip strength, and gait, where Calvo said he expects similar results.

So when is the sweet spot for retirement? The optimal age is around the late 60s but depends on factors from an individual’s financial security to the culture he lives in.

“It’s not that you have to work forever,” Calvo said. But those who retire too early feel more sad and lonely and disconnected. “You’ll be calling your friends to see if they want to play golf or see a movie and they will be at work, and five years later your friends will be calling you and you’ll say ‘I don’t want to play golf anymore.’ You’re living your life at a different pace from your peer group.”

If it’s true that working longer helps keep you healthy, then it may be that U.S. policies implemented for economic reasons will end up having social benefits. As Americans live longer, the retirement age to receive full Social Security benefits has been slowly inching up – traditionally 65, it is currently 66, and for people born in 1960 or later it will be 67.

Research on the topic is burgeoning. Though not all of it is in agreement, several studies comparing people across industrialized nations have shown a strong correlation between early retirement age and diminished cognitive function.

In countries such as France and Austria, where labor force participation among men in their early 60s is lower compared to younger men, cognitive performance was found to be significantly lower than in places like the U.S. and Denmark where older men’s labor force participation was higher, according to a 2010 study published in the Journal of Economic Perspectives.

A 2013 longitudinal analysis by researchers at the University of Padova that controlled for age, physical health, income, education, and early life conditions confirmed the “mental retirement” hypothesis and found that early retirement may also be associated with the onset of dementia. And a study the same year by the French research agency INSERM showed that for each additional year they worked, people reduced their risk of dementia by 3.2 percent.

It’s not just whether you’re retired but for how long: the more years spent in retirement, the higher the risk of cognitive decline, the Italian study found. There were also other factors; for example, if you did well in math at age 10 your brain was less likely to slow down in old age. But if you lived in a rural area during childhood, it was more likely.

The fact that a person is working may not in itself be as important as the kind of work one does, cautions Ursula Staudinger, director of the Columbia Aging Center and the lead author of a 2014 study of assembly line workers in Germany showing that those who changed tasks more often over 16 years had better brain function and cognitive performance than those who did not.

That is true whether or not you are highly skilled. “At every level of education there are types of work that are more complex than other jobs,” Staudinger said. “You don’t have to despair if you have a low-level job, but you have to make sure that at your level you have enough complexity.”

No matter when you retire, be mindful of how you do it, experts advise; retirement can in itself cause psychological stress that increases risk for dementia.

While some people gleefully embrace the end of their working days, others experience anxiety and depression when they lose the mental stimulation and social networks that go along with employment.

Volunteering can help counteract that, though studies show those benefits come only if people are genuinely engaged in their volunteer activities.

“We have found that work stimulates cognitive development to the extent that work is engaging and also challenging,” said Jacquelyn James, co-director of the Sloan Center on Aging and Work at Boston College. “I think we used to think that doing crossword puzzles was the best way to keep our cognitive abililty alive and developing and I think we’re seeing that it takes more than that. It’s much more important to do things that challenge the mind, like learning a new language, or learning a new technology.”

It could be that, even as they reach retirement age, Americans just feel better when they work. In a 2013 Careerbuilder.com survey, sixty percent of workers age 60 and older said they would look for a new job after retiring. And a 2010 report by the Sloan Center and the Families and Work Institute said 75 percent of workers expected to work or embark on a second career after retirement.