No suicide or euthanasia is allowed in Judaism. But are you allowed to pray for your own death?
You can pray for the death of someone who is incurably sick, in pain and dying. This is based on Rabbenu Nissim's (14th century Spain) understanding of Nedarim 40a and Ketuvot 104a, ratified by the Aruch Hashulhan [YD 335:3] and Rabbi Feinstein [Igrot Moshe CM 2:74].
But I have not seen a responsum about whether someone is allowed to pray for his own death. Tanhuma implies that it's allowed, because that's what Moses did:
Moses said: Master of the universe, up to now I requested life, but now here is my soul given over to You. He had resigned himself to death... [Tanhuma on Deut. 31:2]