The 30-year-old joined Leicester in 2017 having previously spent eight years at Gloucester, where he came through the academy.
May, who has 56 Test caps, will move back to his former club once the 2019-2020 season, currently on hold because of the coronavirus pandemic, concludes.
The prolific May has scored 30 tries in 44 appearances for the Tigers, although the club sit second-bottom of the table, with only Saracens, which has a points deduction, below them.
"I'm proud of my time at Leicester Tigers," May said as the team announced his move on Sunday (AEST).
"What an amazing experience to have played for such a great club. It really has developed my game and it's brought the best out in me as a player. I gave 100 per cent every time I put the shirt on and I have no regrets.
"For numerous reasons it hasn't worked out for me to stay on at Leicester Tigers, which is a shame.
"It's been a challenging few years but I have made some great mates and worked with some brilliant people.
"I hope that everyone is staying safe and healthy in this tough period and also really hope that things start improving and I get the opportunity to play for Leicester Tigers, with my mates, a few more times before I leave.
"Thank you to everyone at Leicester Tigers, especially the fans, I'm sorry we haven't given you what you have wanted the last few seasons but I'm very optimistic about the future for Leicester Tigers."
On returning to Gloucester, which sits ninth in the table, May added: "Once I had made the decision to leave Leicester there was only ever one club I really wanted to play for.
"I'm grateful to [director of rugby] David Humphreys and everyone at Gloucester Rugby who have found a way for me to rejoin. I'm very excited about being back in Cherry and White playing at Kingsholm again."