The Catechism in Questions & Answers

548. How and through whom is salvation imparted to the dead?

The dispensation of Holy Baptism with water, Holy Sealing, and Holy Communion for the departed occurs when Apostles perform each of these visible acts on living persons. The effect for salvation here is not for the benefit of the living, however, but for the departed.
Just as Jesus Christ brought His sacrifice on earth, so too salvation is imparted through the Apostles on earth.

Holy Baptism with water: see Questions 481. et seq. Holy Communion: see Questions 494. et seq. Holy Sealing: see Questions 515. et seq.