It was at the Council of Trent that Catholic doctrine on purgatory was defined. The Council in its decree affirms the existence of purgatory and the great value of praying for the deceased. Yet at the same time it sternly instructs that preachers not distract, confuse, and mislead the faithful with unnecessary speculations concerning the nature and duration of purgatorial punishments. From the fifth session, 1563.
The Catholic Church, instructed by the Holy Spirit and in accordance with sacred Scripture and the ancient Tradition of the Fathers, has taught in the holy Councils and most recently in this ecumenical Council that there is a purgatory and that the souls detained there are helped by the acts of intercession (suffragia) of the faithful, and especially by the acceptable sacrifice of the altar.
Therefore this holy Council commands the bishops to strive diligently that the sound doctrine of purgatory, handed down by the Holy Fathers and the sacred Councils, be believed by the faithful and that it be adhered to, taught and preached everywhere.
But let the more difficult and subtle questions which do not make for edification and, for the most part, are not conducive to an increase of piety (cf. I Tim. 1:4), be excluded from the popular sermons to uneducated people. Likewise they should not permit opinions that are doubtful and tainted with error to be spread and exposed. As for those things that belong to the realm of curiosity or superstition, or smack of dishonorable gain, they should forbid them as scandalous and injurious to the faithful.
Related Canon 30 from the Council of Trent’s Decree on Justification (Sixth Sesssion, 1547)
30. If anyone says that after the grace of justification has been received the guilt is so remitted and the debt of eternal punishment so blotted out for any repentant sinner, that no debt of temporal punishment remains to be paid, either in this world or in the other, in purgatory, before access can be opened to the kingdom of heaven, anathema sit [“let him be anathema” or excommunicated].
A modern translation of the Decree on Purgatory by the Council of Trent, 25th session, 1563, the authoritative statement of Catholic dogma on the subject.