If we end up in purgatory after we die, how long will we be there?

The good news is that purgatory is only temporary, a preparation that leads directly to Heaven.

How long does purgatory last?

The Catholic Church speaks sparingly about the final state of preparation that leads to eternal life in Heaven.

The Catechism of the Catholic Church explains, “The Church
gives the name Purgatory to this final purification of the elect … 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” (CCC 1031).

Furthermore, “[E]very 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” (CCC 1472).

The Church does not give a specific amount of “time” to this final place of purification.

On one hand, this is because to speak of an amount of time in Purgatory, it matters what we mean by “time.”
In tradition, purgatory is what supplies the temporal punishment due to
our personal sins. We can say that purgatory has time in the sense that
souls begin and end periods of demarcated purification there. However
it is not, so far as we know, the way we measure time in this life.

Another chief consideration is that purgatory is different for everyone.
God, being a just Judge, deals out a “punishment” according to our
attachment to sin. Each person will have a different attachment at the
moment of death and so each person’s experience of purgatory will be
vastly different. Some people might spend “minutes” in purgatory, while
others could be there for “years.” For this reason there is no possible
way to give a general “time” period to a person’s “residence” in
purgatory.

What is true and immensely important is that purgatory is not eternal.

As the book Purgatory Surveyed explains, “it is most
certain, that these pains are not eternal; otherwise it were not
Purgatory, but hell itself: for in this chiefly lies the difference
between hell and Purgatory, that the pains of Purgatory last but for a
time; those of hell, for an eternity.”

At the end of time, when Our Lord comes again, purgatory will cease
to exist, for all the souls within it will have been purified and its
purpose will be completed. All the souls in purgatory will enter Heaven and when they do, purgatory will be no more.

If you are to enter purgatory some day, rejoice, for you can only go up!