From the 2nd Vatican Council. (summarised, with comment)
Sin must be expiated.This must be done on this earth by sorrows, pains, works, prayers, etc.Otherwise, many years of painful 'cleansing' in purgatory is necessary.The concept of indulgences, which reduces time in purgatory, has come down by divine revelation. (This means secret apostolic traditions known only to the papacy. They just didn't tell anyone else for a thousand or more years.)Even when the guilt of sin has been taken away, punishment or consequence for it may remain to be expiated or cleansed. (And so Jesus didn't do enough by dying, we still have to pay.)
Whereas Jesus:
Let not your hearts be troubled. Believe in God; believe also in me. In my Father's house are many rooms. If it were not so, would I have told you that I go to prepare a place for you? And if I go and prepare a place for you, I will come again and will take you to myself, that where I am you may be also.
...and his disciples said:
If we confess our sins, he is faithful and just to forgive us our sins and to cleanse us from all unrighteousness.
Oh the sweetness of Scripture.