Short Answer
Suicide is forbidden. There is no justification for it, even if you are in pain or fear torture. Try to take medicine to ease the pain and if you fear torture or rape, try to fight off your attacker. If you die in the process you will be a martyr.
What the Qur’an and Sunnah Say
Allah says, “Do not kill yourselves, indeed Allah is Most Merciful to you.” (Qur’an 4:29)
The Messenger of Allah said, “Whoever intentionally throws himself from a mountain and kills himself will be in the fire (of Hell) falling down into it and abiding there eternally. Whoever drinks poison and kills himself with it will be carrying his poison in his hand and drinking it in the fire (of Hell) and will abide there forever. Whoever kills himself with an iron weapon will be carrying that weapon in his hand and stabbing his abdomen with it in the fire (of Hell) and will abide there forever.” (Bukhari & Muslim)
The Prophet also said, “There was amongst those before you a man who had a wound. He was in (such) anguish that he took a knife and cut his hand, and the blood did not cease to flow until he died. Allah said: ‘My servant has acted before Me. I have forbidden him Paradise.” (Bukhari #1298, Muslim #180)
Advice
You should not criticize people who committed suicide because you cannot know what pain they were in. Saying that they should have been patient is much easier said than done. Pray for them and ask Allah to forgive them.
Version 0.25
Shaykh Mustafa Umar