“When a person passes away, his good deeds will also come to an end except for three: Sadaqah Jariyah (ceaseless charity), a knowledge which is beneficial, or a virtuous descendant who prays for him (for the deceased).”
Narrated by Abu Hurairah, Sahih Muslim