There is a lot of epidemiological evidence finding associations between high fitness and incidence or depression as well as depression-symptoms. As for experimental studies, there is modest evidence for a causal relationship suggesting that physical exercise has a moderate effect on the chance of developing depression and can relieve up to 47% of patients from symptoms.
Eleven trials have compared exercise with psychological therapy or pharmacological treatment and found no significant difference. Lower levels of depression symptoms and fewer incidences of relapse has also been seen on 10-month follow-ups of exercised groups compared to pharmacological therapy.
For how long should you exercise?
Specific recommendations cannot be given regarding what type of exercise is best , but more sessions seem to have a larger effect on depression score.
If you want some sort of recommendation a proven dose is 30 minutes of running, three times a week (4). You can probably reach similar results in the gym with superset weight training or circuit training.
Sources:
1. B. K. Pedersen. Exercise as medicine – evidence for prescribing exercise as therapyin 26 different chronic diseases. Scand J Med Sci Sports 2015: (Suppl. 3) 25: 1–72
2. Ranjbar E. Depression and Exercise: A Clinical Review and Management Guideline. Asian J Sports Med. 2015 Jun;6(2):e24055.
3. James A. Blumenthal, Ph.D. Is Exercise a Viable Treatment for Depression? ACSMs Health Fit J. 2012 July/August; 16(4): 14–21.
4. The effect of exercise on depressive symptoms in the moderately depressed elderly. PMID: 1930766