Jami` at-Tirmidhi, Book 15, Hadith 57 (Tirmidhi 1390)

Abu Hurairah, may Allah be pleased with him, narrated that the Messenger of Allah (ﷺ) said:

"When a person dies, his deeds are cut off except for three: Continuing charity, knowledge that others benefited from, and a righteous son who supplicates for him."