Stokes has spent the vast majority of the last year away from home, living in bio-secure environments with England's Test and limited-overs squads and with Rajasthan Royals in the IPL. He missed two of England's Tests against Pakistan last summer in order to see him family in New Zealand, and his father Ged died in December after suffering from brain cancer during the final year of his life.
He has also struggled with a finger injury throughout the summer, which has healed much slower than initially anticipated. Stokes was rushed back to play for Durham in the Vitality Blast after they suffered an availability crisis due to a Covid-19 outbreak in their second XI squad, and then returned to England duty ahead of schedule in similar circumstances, captaining a second-string team to a 3-0 ODI series win against Pakistan.
The ECB said in a statement that it "fully supports" Stokes' decision and that it would "continue to help him during this period away from the game".
Ashley Giles, England's director of men's cricket, said Stokes had "shown tremendous courage to open up about his feelings and wellbeing."
"Our primary focus has always been - and will continue to be - the mental health and welfare of all of our people," Giles said. "The demands on our athletes to prepare and play elite sport are relentless in a typical environment, but the ongoing pandemic has acutely compounded this.
"Spending significant amounts of time away from family, with minimal freedoms, is extremely challenging. The cumulative effect of operating almost continuously in these environments over the last 16 months has had a major impact on everyone's wellbeing.
"Ben will be given as long as he needs and we look forward to seeing him playing cricket for England in the future."
Stokes has been replaced in the squad for the Test series, which starts on August 4 at Trent Bridge, by Craig Overton. His withdrawal is a major blow to England's chances in the series, not least given their struggles in his absence during their series defeat to New Zealand in June.
The news underlines the reasons behind England's controversial rest and rotation policy over the last year, which has seen multi-format players left out of several squads in order to give them periods of time away from the game and with their families to help them cope with a relentless schedule.
England's all-format players are due to fly to Bangladesh and then Pakistan for white-ball series days after the fifth Test against India in September. They will then travel to the UAE for the T20 World Cup and Australia, for the Ashes, where Covid restrictions are among the toughest in the world. Players have held talks with the ECB this week to discuss that tour, and reports have suggested that some will consider withdrawing from the series if they are unable to travel with their families.