إذا مٰاتَ الإنسٰانُ إنقَطَعَ عَمَلُهُ إلاّ مِن ثَلاٰثٍ: إلاّ بِصَدَقَةٍ جٰارِیَةٍ أو عِلمٍ یُنتَفَعُ بِهِ أو وَلَدٍ صٰالِحٍ یَدعوُ لَهُ When a person dies his deeds are finished, save except in three ones: a permanent charity, a knowledge that people will benefit, and a pious child who prays for him.
Mizan al-Hikmah (Scale of Wisdom), Hadith 14287
Rasul Allah Hazrat Muhammad (Peace and blessings of Allah be upon him and his progeny)Hadith