“All who die in God’s grace and friendship, but still imperfectly purified, are indeed assured of their eternal salvation; but after death they undergo purification, so as to achieve the holiness necessary to enter the joy of heaven.” (Catechism of the Catholic Church, Article 1030)
The Church has always understood that those of us (the vast majority of us) who die before we achieve perfect holiness must undergo some sort of final purification before we are permitted to enter the holiness of heaven. In my experience, Protestants tend to not devote much thought or discussion to what this purification might entail. Catholics, on the other hand, and some other faith practices, have defined the doctrine of Purgatory.
We can thank, for the most part, Dante Alighieri and his Divine Comedy for the notion that Purgatory is a “place” where saved-but-still-imperfect folks are tested and purged with the holy fires of God (see picture above). The Dogma of the Church does not describe Purgatory as a place, but more of an experience or process. Maybe it is a place. Maybe not.
What the Magisterium (formal doctrines and teachings) of the Church does say is that Purgatory involves some degree of suffering as the dross of our souls is burnt up in the furnace of God’s sin-consuming love. As fellow Christians, those of us still alive may have the privilege of praying for the departed souls who are experiencing this purification, so that their suffering may be to some extent alleviated or minimized. We may also do good deeds that carry with them Indulgences (more on this another time) and offer those indulgences in remediation of the suffering of a departed loved one.
Most everyone understands that sanctification in this life involves suffering as we crucify our fleshly desires and our self-will and yield our bodies as sacrifices unto Christ. Purgatory is the final culmination of this process of sanctification. Nothing more, nothing less. Think of it as a place if you will. Think of it as a process if you will. Imagine it takes years if that suits you, or imagine it happens in the blink of an eye if you prefer. The Church takes no official stand on the details other than to say purification is essential and, to the extent it is incomplete in this life, must continue after death until it is complete. At that point, the perfectly sanctified individual is prepared to enter into the glory of heaven.
The formal Doctrine of Purgatory was handed down in the late Middle Ages, but it was not an idea that sprang out of nowhere. The Church Fathers and Doctors had taught all along that a final purification of imperfect sinners bound for glory must be necessary. Some cakes take time to bake.