This is a question about which one could write a thick book. I have a few thoughts,
One - a devoutly religious person may very well be a more physically healthy person. Religion teaches that our bodies are temples and as such should be well cared for - so this may bring a person to eat better, exercise more and in general take care of their physical health.
Two: Depression often is the result of actual physical chemical imbalances in the brain and if that is the case, pharmaceutical anti-depressants are called for - or other supplements or a diet change.
Three: Sometimes a religion can become an addiction to a person who already suffers from some unhealthy emotional or mental issues. So in this case the religion becomes a substitute for true health and the depression may lift, but not be cured.
Fourth: It is my belief that a right relationship with God through religious beliefs can lead us to search for meaning and search for reasons for our depression - even lead us into professional therapy. A deep searching for oneself can bring us to find answers and lift the illness of depression. In addition, a relationship with God teaches us that we matter to God and that we are loved - an acceptance of this will work against the depression on an emotional and spiritual basis.
As I said this is not a quickly answered question as it has many sides to it.