The ruling on one who commits suicide
A Muslim who kills himself by mistake is excused and is not sinful because of that act. But a Muslim who, worn down by circumstances, deliberately commits suicide, without being displeased with the decree and destiny of Allah, the Exalted, is not a disbeliever. Rather, he has committed a major sin, and the threat and warning of the Fire applies to him. His matter is left to Allah: if He wills, He will overlook it and forgive him, or if He wills, He will punish him.
Reference: Al-Lajnah al-Da’imah: 5958