For Denworth, who talks about concentric circles of friendship based on closeness, “It’s better that ambivalent relationships don’t live in the center of the circle.” Ideally this type of friendship would be repaired, culled, or moved to a further circle. For while strong friendships bring strong health benefits, a higher number of ambivalent relationships is associated with higher blood pressure, accelerated cellular aging, and other harms.

As Shakes says of some friendships: “You can have tons of friends and you can still be lonely.”

The practical implications of friendship science

Research suggests a link between time spent with friends and whether the brain processes rejection as threatening later. For example, a study of Los Angeles high-schoolers found that those who had spent more time with friends showed less sensitivity to social exclusion, even up to two years later.

“The more you have positive interactions with friends, you could be keeping a well-functioning reward system that could have counter effects on these neural responses that you have when you experience more adverse social interactions, or feel excluded,” Güroglu muses. But she stresses that this is speculative, as a great deal of neuroscience research remains to be done over longer stretches of people’s lives.

And while “patients with depression have been shown to have some problems with the functioning of the reward system”, it will take more research to illuminate the individual differences in how this works.

What’s clear from the broader science of friendship is that cultivating friendship should be a lifelong process. “People in midlife make a mistake if they think they can just wait until their 50s and 60s to focus on friendship,” Denworth says, while acknowledging that midlife pressures from family and career mean that friends often fall to the wayside. “It’s a life course and it’s a muscle that has to be worked.”

On the clinical side, this means that health interventions focused on fighting loneliness shouldn’t just target older people. Some doctors may be asking older patients about their friendships given the protective effect against dementia, but these aren’t the only patients who could benefit.

Social prescribing, where doctors prescribe social or recreational activity for their patients alongside or instead of more conventional medical treatment, has also often been associated with the elderly. But Turnbull, who develops socially prescribed activities at Camden Voluntary Action, feels that it’s useful across the age spectrum. “Loneliness isn’t the domain of older people,” Turnbull notes.

She’s seen powerful benefits from Camden residents taking up volunteering, joining walking groups, and the like. Some people stop taking antidepressants, for example, though this should only be done in consultation with a doctor.

The biggest demand she sees is not for one-off activities but for longer-term programs that can build lasting friendships. “It has a knock-on effect,” Turnbull believes. “You build your social networks, you become more capable of dealing with health issues or those wider determinants of health like housing, etc.”

Of course, social prescribing isn’t a cure-all, and may not be affordable for everyone. “The cost of living is definitely stopping people socialising,” says Turnbull. Access to transport and even the price of a cup of tea may be a barrier.

Generally, while there is a need for more systematic evidence about what types of interventions work best when it comes to health-promoting friendships, there are simple steps that nearly all of us can take now. One basic lesson is that friends shouldn’t be taken for granted. As Denworth says: “We have limited time in the day, and friendship does require an investment.”

That investment isn’t always easy, but it pays dividends. Shakes said that his doctors, on understanding his mental health situation, said he needed to start finding friends. “But I didn’t really understand what it meant,” he reflects now.

“I mean, it took me 18 years to realize and understand my condition, my mental health and get the right balance of friends and care.”

Join one million Future fans by liking us on Facebookor follow us on Twitter or Instagram.

If you liked this story, sign up for the weekly bbc.com features newslettercalled “The Essential List” – a handpicked selection of stories from the BBC Future, culture, Worklife, Travel and reels delivered to your inbox every Friday.