The scriptural warrant is Jesus' assertion that "you shall not come out of it until you have paid the last penny." Also, time in Purgatory could be shortened by indulgences, not by the sale of them. The sale was the abuse, not the indulgence.
Dante also described Purgatory. It had very little scriptural warrant but which greatly increased the spiritual influence of the Roman Catholic Church (because one's fate was not settled at death) and gave rise to many abuses, since the soul's time in Purgatory could supposedly be shortened by the earthly sale of "indulgences."
What is interesting is that the notion of survival after death arose so early in human history.