There is plenty of theological debate on purgatory, as there has been for many centuries.
But dogmatically the Roman Catholic church teaches only that purgatory exists and that the prayers, devotions, alms, etc. of the living can be efficacious for the souls there. Everything else is up for discussion.
The currently dominant view among theologians, not least among the late John Paul II, is that purgatory is not a place but a state.
The Catechism says:
1030 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.
1031 The Church gives the name Purgatory to this final purification of the elect, which is entirely different from the punishment of the damned.606 The Church formulated her doctrine of faith on Purgatory especially at the Councils of Florence and Trent. The tradition of the Church, by reference to certain texts of Scripture, speaks of a cleansing fire.607
"As for certain lesser faults, we must believe that, before the Final Judgment, there is a purifying fire. He who is truth says that whoever utters blasphemy against the Holy Spirit will be pardoned neither in this age nor in the age to come. From this sentence we understand that certain offenses can be forgiven in this age, but certain others in the age to come."608
1032 This teaching is also based on the practice of prayer for the dead, already mentioned in Sacred Scripture: "Therefore [Judas Maccabeus] made atonement for the dead, that they might be delivered from their sin."609 From the beginning the Church has honored the memory of the dead and offered prayers in suffrage for them, above all the Eucharistic sacrifice, so that, thus purified, they may attain the beatific vision of God.610 The Church also commends almsgiving, indulgences, and works of penance undertaken on behalf of the dead:
"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."611
606 Cf. Council of Florence (1439):DS 1304; Council of Trent (1563):DS 1820; (1547):1580; see also Benedict XII, Benedictus Deus (1336):DS 1000.
607 Cf. 1 Cor 3:15; 1 Pet 1:7.
608 St. Gregory the Great, Dial. 4,39:PL 77,396; cf. Mt 12:31.
609 2 Macc 12:46.
610 Cf. Council of Lyons II (1274):DS 856.
611 St. John Chrysostom, Hom. in 1 Cor. 41,5:PG 61,361; cf. Job 1:5.
The "purifying fire" need not be literal, of course. It's a biblical metaphor, referring to the purifying properties of fire. It's the purifying kind of fire, not the consuming kind of fire found in Hell.
As St. Paul writes, a righteous man's works will be tested. But if he fails the test, "He will suffer loss, though he himself will be saved, but only as through fire." (1 Cor 3:15)
I always had trouble with purgatory growing up. Once I was old enough to investigate it, the problems went away as I realized that most of what I thought was purgatory wasn't true. My Baptist father had been feeding me lots of misinformation.
edited to indicate specificity of dogmatic source.