Exactly as the title asks; where do Catholics get their Scriptural support for the idea of Purgatory? To be more specific, how I think of Purgatory (which may be incorrect) is that it's a temporary place of suffering before one goes on to Heaven.
From what I understand, the idea behind Purgatory is that it is a place or state where sinful believers go before they are admitted to Heaven. It is believed that it is possible for the living to pray for and atone for the sins of the dead so they may be admitted into Heaven.
(Italics were added by me in the following)
39 And the day following Judas came with his company, to take away the bodies of them that were slain, and to bury them with their kinsmen, in the sepulchres of their fathers.
40 And they found under the coats of the slain some of the donaries of the idols of Jamnia, which the law forbiddeth to the Jews: so that all plainly saw, that for this cause they were slain.
41 Then they all blessed the just judgment of the Lord, who had discovered the things that were hidden.
42 And so betaking themselves to prayers, they besought him, that the sin which had been committed might be forgotten. But the most valiant Judas exhorted the people to keep themselves from sin, forasmuch as they saw before their eyes what had happened, because of the sins of those that were slain.
43 And making a gathering, he sent twelve thousand drachms of silver to Jerusalem for sacrifice to be offered for the sins of the dead, thinking well and religiously concerning the resurrection,
44 (For if he had not hoped that they that were slain should rise again, it would have seemed superfluous and vain to pray for the dead,)
45 And because he considered that they who had fallen asleep with godliness, had great grace laid up for them.
46 It is therefore a holy and wholesome thought to pray for the dead, that they may be loosed from sins.
a_hardin has it pretty well summed up.
There's also 1 Peter 3:18-20 (NIV) that supports this notion quite well.
18 For Christ also suffered once for sins, the righteous for the unrighteous, to bring you to God. He was put to death in the body but made alive in the Spirit. 19 After being made alive, he went and made proclamation to the imprisoned spirits— 20 to those who were disobedient long ago when God waited patiently in the days of Noah while the ark was being built. In it only a few people, eight in all, were saved through water,
These "imprisoned spirits" had to be somewhere.
It's a stretch to make it from this verse to the Catholic concept of Purgatory. However, this odd little section of scripture could easily be seen to support the concept of Purgatory.
I originally used this answer to What is the scriptural basis for the idea that salvation can still be obtained after death? but I deleted it because it was answering a different question. This question.
There are a lot of scriptures that could reference purgatory, but nothing that outright says "when you die, you will go to a sort of holding place where you have to wait until all your sins have been repaid".
There was a large part of the Jewish tradition (and there may still be) that held with praying for people after they died. Gen. 50:10; Num. 20:29; Deut. 34:8 all reference times when that happened. And this probably played into the later beliefs by Catholic and Orthodox Christians in purgatory. I would point out, however, that as Jesus died to pay for our sins, all our debts have been paid and we have been washed clean so that we don't have to pay for them anymore.
Below you will find links to two different sites I looked at that had Biblical "references" and some of my own analysis based on the context of the verses and my own experience with the Bible.
The biggest Biblical support the article quotes is from 2 Maccabees, a book that most Protestants would not be familiar with as it is part of the Biblical apocrypha (referenced since the 5th century, but first separated from the rest of the Bible by Martin Luther in 1534). Most of the books called Apocryphal are recognized as canonical by the Catholic and Orthodox churches. Which is why those sects and not Protestant sects would hold to a doctrine supported by this verse.
It is therefore a holy and wholesome thought to pray for the dead, that they may be loosed from their sins.
- 2 Maccabees 12:46
The other verse referenced by the article is 1 Corinthians 15:29 which says
Now if there is no resurrection, what will those do who are baptized for the dead? If the dead are not raised at all, why are people baptized for them?
At best, this verse is a vague reference to baptizing dead people, where baptizing could be read as praying for the removal of sins. At worst, it's completely confusing and should not be used as the basis for a doctrine.
Anything in bold is a paraphrased quote from the site.
Matt. 5:26,18:34; Luke 12:58-59 - Are all in different parables and reference being punished for sin and getting out when you have repaid your debt. This could be a reference to purgatory, where you must remain until the debts of your sins have been paid. However, since Jesus died to pay for our sins, this is a case where the more clearly defined and supported doctrine would supersede a possible interpretation of a parable.
Matt. 12:32 - The argument here is that since it says they won't be forgiven in this world or the next, that means that it is possible to be forgiven "in the next". Some interpretations of the Bible say "this age or the next", "in this world or that which is to come", or "in this life or in the life to come" which seem to indicate when Jesus returns again rather than a world after death that is separate from Heaven or Hell.
Luke 16:19-31 - The rich man, from Hell, begs Lazarus to warn his brothers so that they don't end up there too. The Greek word used is hades which the Jewish people interpreted as a place of waiting for final judgement but is interpreted by Protestants to mean Hell.
Heb. 12:23 - The spirits of just men are made perfect. And this happens after their death, so that must mean it happens somewhere other than Heaven or Hell. OR it could happen before they get to Heaven so that when they are in Heaven they are perfect.
Rev. 21:4 - God shall wipe away their tears and there will be no more suffering. There's no suffering in Heaven and no wiping away of tears in Hell, therefore purgatory. OR for those who are still on Earth at the end times God will wipe away their tears.
Phil. 2:10 - Under the Earth means purgatory OR it could mean Hell.
There are more, but those are the ones that stood out to me.
The answer to the question is in 1031 & 1032. Please see the footnotes for the biblical references. Picking one, certain offenses can be forgiven in this age, but certain others in the age to come (please see CCC 1031 below).
1031 The Church gives the name Purgatory to this final purification of the elect, which is entirely different from the punishment of the damned.1 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:2
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.3
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."4 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.5 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.6
1. cf. Council of Florence (1439):DS 1304; Council of Trent (1563):DS 1820; (1547):1580; see also Benedict XII, Benedictus Deus (1336):DS 1000.
2. cf. 1 Cor 3:15; 1 Pet 1:7.
3. St. Gregory the Great, Dial. 4,39:PL 77,396; cf. Mt 12:31 -32.
4. 2 Macc 12: 45.
5. cf. Council of Lyons II (1274):DS 856.
6. St. John Chrysostom, Hom. in 1 Cor. 41,5:PG 61,361; cf. Job 1:5.
OP: To be more specific, how I think of Purgatory (which may be incorrect) is that it's a temporary place of suffering before one goes on to Heaven.
This is answered from CCC 1472. In part:
The punishments of sin 1472 [...]. On the other hand every sin, even venial, entails an unhealthy attachment to creatures, which must be purified either here on earth, or after death in the state called Purgatory. This purification frees one from what is called the "temporal punishment" of sin. [The punishment] must not be conceived of as a kind of vengeance inflicted by God from without, but as following from the very nature of sin. [...]
The analogy that comes to mind is a sick person who willingly undergoes a painful treatment or operation. They suffer in gladness knowing in the end they will be restored to a better quality of life.
I've also heard Luke 16:19-31 (the story of the rich man and Lazarus) used to explain Purgatory. Specifically Verse 23 "In Hades, where he was in torment, he looked up and saw Abraham far away, with Lazarus by his side."
Abraham had to be somewhere as he wasn't in Hades and couldn't be in Heaven yet.