The Messenger of Allah ﷺ said, "None of you should wish for death, nor pray for it before it comes to him. When one of you dies, his deeds come to an end, and a believer's life only adds to his good."
وقال رسول الله ﷺ لا يتمن أحدكم الموت ولا يدع به من قبل أن يأتيه إنه إذا مات أحدكم انقطع عمله وإنه لا يزيد المؤمن من عمره إلا خيرا
This is a sahih hadith by virtue of the soundness of the Sahifah, and it appears in the individual Sahifah, number 76. Muslim narrated it, 8:65 (Sindi edition) / 2:308 (Bulaq edition), through the route of the Sahifah, but Bukhari did not narrate it through that route, and he did not narrate it with this wording, as we shall mention, Allah willing.Bukhari narrated, 13:189–190 (Fath), through the narration of Abu Ubayd, the freedman of Abdul-Rahman bin Azhar, from Abu Hurairah, as a raised report, "None of you should wish for death, whether he is one who does good, for perhaps he will increase in it, or one who does wrong, for perhaps he will seek forgiveness." He had narrated something similar before this, at 10:109–110, from this same route, along with another hadith. This hadith of Bukhari's has already appeared in the Musnad at numbers 7568 and 8072.As for the phrase "and indeed it only increases the believer's lifespan in good," this is what is established in the two manuscripts of the Musnad, M, and Jami al-Masanid, and it agrees with the narration of Muslim. In H, and in the individual Sahifah, it reads "it only increases the believer, in respect of his lifespan, in good," with the addition of the word "min" after the word "believer." This addition, although it could possibly be correct, contradicts the rest of the reliable sources. And in the individual Sahifah, it appears without the conjunctive waw.