Purgatory is for people who are going to Heaven. That surprises a lot of readers, so it's worth saying first. Nobody ends up there as a verdict against them. Every soul in Purgatory is saved, because they died in friendship with God, and that settles where they are headed.
So why a stop along the way? Because being God's friend and being ready to stand in front of Him are not always the same thing. Think of the people you know who truly love God. Most of them still carry something: a quick temper, a grudge held a little too long, a vanity they have never quite shaken. The love is real, but it's tangled up with other things. The Church teaches that God finishes the untangling after death, for those who still need it, so that nothing is left between them and Him. That finishing is what we call Purgatory (CCC 1030).
People often mix it up with two other ideas. It is not Hell with an exit door. The Catechism says it is "entirely different" from the punishment of the damned, and the difference lies in the direction of the heart. One is love refused, the other is love being made complete. And it is not a second chance. Nobody changes sides after death. The souls there have already said yes to God, and what remains is getting ready for what they said yes to.
None of this was invented in the Middle Ages. Christians were praying for their dead in the catacombs, and the Bible shows the same instinct, most clearly in 2 Maccabees 12. The Church defined the teaching formally at the councils of Lyons, Florence and Trent, but she was putting words to something her people were already living.
What we don't know matters too. The Church has never told us where Purgatory is, how long anyone stays, or whether the fire the tradition speaks of is literal. Time doesn't work the same way after death, so even "how many years?" may not be a question that makes sense. It's better to think of Purgatory as a condition than a location.
And that is why it concerns the rest of us. Death doesn't cut the bond between us and the people we love. The Church teaches that we can help the souls in Purgatory, above all by offering Mass for them, and also through prayer, almsgiving and indulgences. If you have lost someone, that may be the most hopeful sentence in the whole teaching. There is still something you can do for them.
If you'd like to begin right now, the oldest prayer is also the shortest.
.