Old Testament.
1 Corinthians 3:11-15- “For other foundation can no man lay than that is laid, which is Jesus Christ. Now if any man build upon this foundation gold, silver, precious stones, wood, hay, stubble; Every man's work shall be made manifest: for the day shall declare it, because it shall be revealed by fire; and the fire shall try every man's work of what sort it is. If any man's work abide which he hath built thereupon, he shall receive a reward. If any man's work shall be burned, he shall suffer loss: but he himself shall be saved; yet so as by fire.”
2 Maccabees 12:46: “Thus he made atonement for the dead that they might be freed from sin.”
New Testament
Matthew 5:26 and Luke 12:59 Christ is condemning sin and speaks of liberation only after expiation. “Amen, I say to you, you will not be released until you have paid the last penny.” Now we know that no last penny needs to be paid in Heaven and from Hell there is no liberation at all; hence the reference must apply to a third place.
Matthew 12:32, “And whoever speaks a word against the Son of Man will be forgiven; but whoever speaks against the holy Spirit will not be forgiven, either in this age or in the age to come.” Here Jesus speaks of sin against the Holy Spirit. The implication is that some sins can be forgiven in the world to come. We know that in Hell there is no liberation and in Heaven nothing imperfect can enter it as we see in the next part. Sin is not forgiven when a soul reaches its final destination because in heaven there is no need for forgiveness of sin and in hell the choice to go there is already made.
Revelation 21:27: “…but nothing unclean will enter it, nor anyone who does abominable things or tells lies.” The place that is to be entered (the place to which this passage refers) is heaven (read the text around it for context).
Catechism. http://www.vatican.va/archive/ccc_css/archive/catechism/p123a12.htm
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