This is a really interesting question. Just based on my experience, I think altruism can really help to improve someone's mental health - but only if they're in a reasonably good place already. It's like they say - you can't look after others if you don't look after yourself first.
A couple of years ago, my grandma was seriously ill (dementia and other age-related health issues) and I was spending a lot of time trying to help my grandad to look after her. It was in the run-up to me moving to Australia, so I was trying to juggle my job, intensive driving lessons, packing up, finding a new place to live etc at the same time as looking after her and then later visiting her every other day in hospital. It was a really low period for me - obviously I was upset to see my grandma ill but I also felt horribly guilty that I couldn't do more for her. Whatever I did, it never felt like enough - even though I can see now with hindsight that I did help to make her more comfortable in some ways and helped to take the pressure off my grandad a bit. But at the time it didn't feel like that and I was constantly breaking down in tears and self-harming too. I think that I was trying to do too much and wasn't taking enough time to look after myself.
At other times, when I've been in a better place, I've found that helping others really gives me a boost, whether it's something formal like volunteering with kids at the local library or more informal like taking extra time to talk to a junior colleague who needs a bit of support while they settle into the job. I guess it's like a lot of things, like exercising and eating right and being sociable - you know that they can help you feel better, but sometimes you just can't bring yourself to do them. I think the key thing I've learned is to monitor myself every day and make sure that all the things I'm trying to do aren't running me down.