It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When a person dies, his deeds are cut off, except that three things remain: an ongoing charity, knowledge from which benefit is derived, and a righteous child who prays for him."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الوصايا / 12635