Sahih Muslim Book 035, Hadith Number 6480.

Chapter : It is not something appreciable to make request for death from the Lord when one is in trouble.

Anas (b. Malik) reported Allah's Messenger (may peace be upon him) as saying. None of you should make a request for death because of the trouble in which he is involved, but if there is no other help to it, then say: O Allah, keep me alive as long as there is goodness in life for me and bring death to me when there is goodness in death for me.