I'm going to be black sheep here and say that I do think there might be a correlation between atheism and depression, but correlation is not causation. It's not like, okay, I've done some thinking, some serious self-reflection and I can say that I'm a card-carrying atheist now and... wait... what is that black cloud of despair peaking around behind that corner? Oh shit. It's coming this way. Oh shit. Oh shit. GET IT OFF. I DO BELIEVE IN FAIRIES. I DO. I DO....
Depression, apart from the kind that results from chemical imbalances due to genetics or some serious drug abuse or psychological trauma, does typically come on the heels of an existential crisis and I think its safe to say that most atheists are born of these. Most atheists I know or have ever heard of are frequently former theists themselves or, even if they weren't, they've grown up in a society where religion's doctrine and beliefs still permeate every social cell of their existence even though they may have never consciously attributed these beliefs to the majority's belief in a deity. In many respects, the external locus of control and other psychological side-effects afforded by religion, by fate, by astrology and other supernatural and metaphysical forces are a huuuuuuge part of our social consciousness and separating yourself from the herd, separating your beliefs and all their underlying roots and tentacles from the fabric of the current social milieu is a minefield rife with conscious and subconscious cognitive dissonances that don't buckle under the clear-eyed might of reason. At the core, we're social animals and much of who we are is shaped by our environment. We are also not consciously privy to the deeper workings of our psyches and its influences. It's not that religion keeps people happy. It's belonging. It's validation. It's the realized desire of being surrounded by people and ideas that are congruent with your beliefs and ideas, overtly or otherwise.
Anyone who has ever felt like they've been alienated from society, consciously or subconsciously, socially, physically, emotionally, cognitively, is prone to depression.