I'm religious but I still feel suicidal sometimes. However, I don't believe God is anti-suicide or that you get punished for killing yourself. God is all-knowing and all-loving, so if I decide to ctb He will know exactly why, understand me, and forgive me. I believe that's the case for everyone, so long as you choose to do good to the best of your ability.
Religion helped me feel like I had control over my life when I otherwise had none. It helps me feel less afraid of both life and death. So in that way, it's a comfort when I feel suicidal, but it doesn't make it go away. It's hard to fight genetic predisposition and millions of unfortunate (or fortunate in the wrong combinations) environmental variables though.