This claim is true, there is enough evidence to support that participating in sports can greatly increase mental well-being. This does depend on factors of type of sport, how often they participate, and level of competition involved, but this claim holds generally true.
In a systematic review analyzing 29 studies of adults, they found that sports participation was associated with improved psychosocial well-being, reduced mental illness, and enhanced social benefits. They also found that these effects were greater in team sports than in individual sports, due to social interaction and peer bonding. Also, stronger results were found in participants who had more frequent participation.
One consideration of this fact is when it gets to the higher professional level, studies found that elite athletes experience higher levels of psychosocial distress. However, this claim hold true!
https://pmc.ncbi.nlm.nih.gov/articles/PMC10286465/