Exercising is investing into your mental health. No, really.
The paper Sitting-Time, Physical Activity, and Depressive Symptoms in Mid-Aged Women (J.G.Z. van Uffelen et al.; 2013) presents the results of a study that took a look at the possible connection of depressive symptoms and physical activity in Australian women in their fifties, through a period of nine years. These variables were noted in quite broad terms (no/some/adequate physical exercise; hours of sitting time per day) and self-reported, but the results were predictable.
In fact, women who sat for more than 7 hours a day with no physical exercise would be three times more likely to report on depressive symptoms than those who sat less than 4 hours a day and met the physical activity guidelines. However, the sitting time itself doesn't seem to have much of an effect on the future depressive symptoms — it was the lack of physical exercise that tipped the scale (the status was noted down every three years). Additionally, women with depressive symptoms were less likely to increase their physical activity through the recorded time period, which did not help their mental health in this regard.
Approximately 6% of the human population struggles with major depression each year — it was the 11th leading cause of adult disease burden in 2010, and projections predict that it will take the second spot worldwide in 2030, becoming the leading cause in high-income countries. Some studies predict physical exercise to have protective effects against depression for up to 26 years later, but this particular study aimed at taking the predominantly sedentary lifestyle of the citizens of high-income countries into consideration. In their definition, sitting time refers to any activity with a low energy expenditude, in a sitting or reclining position. The reason that they decided to consider this were results connecting high sitting time with cardiovascular diseases and a decreased life expectancy. However, previous studies had already shown an inverse correlation with sedentary time and mental health in older adults, disadvantaged women, and overweight and obese adults, which makes their results a little bit redundant — but it is the first study of this type that took note of these factors through a longer time period.
In short, if you want to make sure to not develop (or reinforce) depressive symptoms in the next few years, make sure to do plenty of physical exercise; and if you're trying to stifle them in the near future, reduce your sitting time and keep exercising. Simple.