Need advice

My boyfriend seriously has something wrong with him, he keeps going through these cycles where he's so upset and cries all night and says he "can't do this anymore" and then the next day or few days later he's miserable and then after that he is normal and then it repeats. We have a daughter together who is only 3 months old and I feel like I need to leave because it's a toxic relationship but then when he has his good days he's the person I fell in love with and I'd be so nervous of what he would do if I did leave. I don't want anything to happen to him. I just feel like I need to be free from this. It weighs me down so much and it's gotten to the point where I end up being so mean when he's upset because I'm so frustrated by it and I don't mean to be. It's just too much for me to handle. What do I do? He's been going to therapy and it's not helping. Am I wrong for wanting to leave?