This statement as such is still just about correlation, not causation (compare ice cream sales and drowning deaths).
But it has been studied.
* CONCLUSIONS: Religious affiliation is associated with less suicidal behavior in depressed inpatients. After other factors were controlled, it was found that greater moral objections to suicide and lower aggression level in religiously affiliated subjects may function as protective factors against suicide attempts. Further study about the influence of religious affiliation on aggressive behavior and how moral objections can reduce the probability of acting on suicidal thoughts may offer new therapeutic strategies in suicide prevention.*
http://ajp.psychiatryonline.org/doi/abs/10.1176/appi.ajp.161...
A religious person in pain without hope looks at suicide as an option and thinks, "I've got it bad now, but it's only going to get worse if I do this..."
Whereas a non-religious person is thinking, "I've got it bad now, but if I do this I won't have to feel anything ever again"