The tradition of offering Masses for others, particularly the dead, originates in the very early Church, and we must never forget the infinite graces that flow from the Sacrifice of the Mass which benefit one’s soul.
In the Canons of Hippolytus (c. 235) which explicitly mentions that the offering of prayers for the dead during the Mass. St. Cyril of Jerusalem (d. 386), in one of his many catechetical discourses, explained how at Mass both the living and dead are remembered, and how the Eucharistic Sacrifice of our Lord is of benefit to sinners, living and dead. St. Ambrose (d. 397) preached, “We have loved them during life; let us not abandon them in death, until we have conducted them by our prayers into the house of the Lord.” St. John Chrysostom (d. 407) stated, “Let us help and commemorate them. If Job’s sons were purified by their father’s sacrifice, why would we doubt that our offerings for the dead bring them some consolation? Let us not hesitate to help those who have died and to offer our prayers for them.” St. Augustine (d. 430) recorded the dying wishes of his mother, St. Monica in his Confessions: “One thing only I ask you, that you remember me at the altar of the Lord wherever you may be.” Finally, Pope St. Gregory (d. 604) said, “Let us not hesitate to help those who have died and to offer our prayers for them.”
(Excerpted from catholicexchange.com).