It is narrated from Sayyidah Umm al-Fadl (may Allah be pleased with her), the wife of Abbas (may Allah be pleased with him), that the Messenger of Allah (peace and blessings be upon him) visited Abbas (may Allah be pleased with him) while he was ill, and Abbas (may Allah be pleased with him) wished for death. At that the Messenger of Allah (peace and blessings be upon him) said: "O uncle, do not wish for death. If you are a doer of good, then a longer life will add further good to your good deeds; and if you are one who falls short, then a longer life will give you the chance to make amends for your shortcomings. That is better for you, so do not wish for death."
Hadith Referenceالمعجم الكبير للطبراني / مسند النساء / 21507