By our faith and charity we can offer to God satisfaction for the souls in Purgatory, and trust to the goodness of God to accept our satisfaction for them in the most generous measure compatible with justice. For, after all, when we pray for the faithful departed, it rests with God to accept our prayers and good works in their behalf.
A lifelong sinner, but one who repented at the last, might have a thousand Masses offered for his soul by the generosity of his friends, or by a stipulation in his will, yet Almighty God might see fit not to accept them in his behalf. Such a soul, forgiven by God's mercy, might have to suffer chastisement for his sins to the day of judgment. One cannot purchase one's way to heaven. In praying for the faithful departed we do so by way of suffrage, that is, we offer our good works to God in their behalf, leaving it to Him to accept them for those for whom they are offered.
Of this however, we can be certain, that since He invites us to pray for them, no prayer of ours in their behalf goes without giving them some assistance. The doctrine of Purgatory is a great help to the living, since it enables them to practice charity in a high degree, and a consolation to the souls in Purgatory since it gives them hope that their period of probation may be shortened. It also helps the practice of faith, by causing us to make sacrifices in our daily life in accordance with the teaching of faith; and finally it aids in the practice of Christian hope, because we trust that the good God will not only be merciful to those for whom we pray, but to ourselves also, who for love of Him pray for those who love Him and whom He loves and whom He desires to welcome home as soon as they are made ready for His loving embrace. "It is a holy and wholesome thought to pray for the dead that they may be loosed from their sins."
Source: "Things Catholics are asked about" by Fr. Martin J. Scott, S.J.Litt.D.