Purgatory isn't explicitly mentioned in Scripture. But can be found implicitly in it, and in light of the Sacred Tradition.
Heaven and Hell are eternal destinations:
"And these will go away into eternal punishment, but the righteous into eternal life." Matthew 25:46
However the bible seems to mention a temporal destination for those who still have debts to pay before going to Heaven:
"Make friends quickly with your accuser, while you are going with him to court, lest your accuser hand you over to the judge, and the judge to the guard, and you be put in prison; truly, I say to you, you will never get out till you have paid the last penny." Matthew 5:24-26
Here Matthew 5 is suggesting, that such prison is not eternal. The interpretations I've seen on this verse however are not always the same. Some say its hell. Ive seen Tertullian interpreting this as hell, while Cyprian of Carthage speaks of this prison as a state or place of purgation for your sins as the following quote shows:
"it is one thing, when cast into prison, not to go out thence until one has paid the uttermost farthing [Matt 5:26, Matt 18:34]; another thing at once to receive the wages of faith and courage. It is one thing, tortured by long suffering for sins, to be cleansed and long purged by fire; another to have purged all sins by suffering. It is one thing, in fine, to be in suspense till the sentence of God at the day of judgment; another to be at once crowned by the Lord" (Letters 51:20 [AD 253])
-Cyprian of Carthage
Other verses to consider:
"But nothing unclean will ever enter it...." Rev 21:27
"It" meaning heaven. This means that a person even with the slightest fault cannot enter Heaven.
"Anyone who speaks against the Son of Man can be forgiven, but anyone who speaks against the Holy Spirit will never be forgiven,** either in this world or in the world to come." Matthew 12:32**
Here Jesus seems to imply that sins can be forgiven in the world to come. If so, then there must be a 3rd place other than Heaven or Hell, since sins cannot be forgiven in either of these; not in hell because the person is damned and needs not forgiveness, and not in Heaven where no sin can enter. Here is St. Augustine's interpretation:
"But temporary punishments are suffered by some in this life only, by others after death, by others both now and then; but all of them before that last and strictest judgment. But of those who suffer temporary punishments after death, all are not doomed to those everlasting pains which are to follow that judgment; for to some, as we have already said, what is not remitted in this world is remitted in the next [Matthew 12:32], that is, they are not punished with the eternal punishment of the world to come." (City of God, 21:13 [A.D. 426]).
"It is therefore a holy and wholesome thought to pray for the dead, that they may be loosed from sins." 2 Macc 12:46
The above verse comes from the second book of the Maccabees. While protestants do not have it as scripture, they must nevertheless recognize it as historical, because some Jews did (and do) believe in a purification (a purgation) which takes place after death. When a Jewish person’s loved one dies, it is customary to pray on his behalf for eleven months using a prayer known as the mourner’s Kaddish (derived from the Hebrew word meaning “holy”). This prayer is used to ask God to hasten the purification of the loved one’s soul. The Kaddish is prayed for only eleven months because it is thought to be an insult to imply that the loved one’s sins were so severe that he would require a full year of purification. It is further prayed on the death anniversary of the loved one. The practice of praying for the dead has been part of the Jewish faith since before Christ. Catholics inherited this practice, and we pray for our departed ones so that our God may loose them from their sins.
"We read in the books of the Maccabees [2 Macc. 12:43] that sacrifice was offered for the dead. But even if it were found nowhere in the Old Testament writings, the authority of the Catholic Church which is clear on this point is of no small weight, where in the prayers of the priest poured forth to the Lord God at his altar the commendation of the dead has its place" (The Care to be Had for the Dead 1:3 [A.D. 421]).
"Then we make mention also of those who have already fallen asleep: first, the patriarchs, prophets, apostles, and martyrs, that through their prayers and supplications God would receive our petition, next, we make mention also of the holy fathers and bishops who have already fallen asleep, and, to put it simply, of all among us who have already fallen asleep. For we believe that it will be of very great benefit to the souls of those for whom the petition is carried up, while this holy and most solemn sacrifice is laid out". (Catechetical Lectures 23:5:9 [A.D. 350]).
*-Cyril of Jerusalem