Learning keeps your mind engaged and body active. It helps you get new and knowledge-based perspectives on the world around you. It helps you gain new experiences, trains your brain to handle a wide range of challenges, and keeps your neural pathways active. All these factors combine to keep you healthy.
Learning is also exciting and rewarding, so it can be therapeutic for a troubled mind. It helps discover your unknown potentials, so you stop beating yourself up for failing in one career path.
Growing your skillset helps you realize how useful you are to lots of people, and that makes you happy and mentally healthy.