There have been a lot of studies done on vitamin D supplements, and there is essentially no significant evidence that supplementation is useful for anything. The sole exception is rickets, which is caused by vitamin D deficiency.
There is also considerable debate over the comparative efficiency & effects of natural synthesis via sunlight vs ingesting supplements, compounded by the difficulty of accounting for things like exercising outdoors vs being sedentary indoors.
Annecdotal: I live in a fairly northern country, and I've heard quite a lot of people say their mood is more normal over winter if they supplement with Vitamin D.
I don't have any strong opinion one way or another on the efficacy of vitamin D. But people who say they feel better after taking it may themselves be experiencing a placebo effect. Placebo effects are real, and they can improve both mood and health. The mind is an amazing thing.