Review of data for over 55,000 women between 2006 and 2010 found that those who had given birth at least once had an approximately 30% lower risk of bipolar disorder and major depression. The effect was greater for two or more children than for just one.
Summary: https://www.psypost.org/study-suggests-two-children-may-be-best-for-womens-mental-health/
Original paper (not open access): https://www.sciencedirect.com/science/article/abs/pii/S0165032724016987