Well, let me put it into language you are probably more familiar with.
"Temporal punishment" is what I think you may know as "discipline" - as in 'God is a loving Father who disciplines His children when they sin.'
Incarceration is a very good example, since this is not relevant to any questions about entering heaven, but has to do with things on this earth, like crime and societal punishment (earthly repercussions of our sin).
OK so you commit a crime and are incarcerated. The incarceration itself is human justice. But since all is ultimately in God's hands, God is allowing you to go to jail as part of your discipline. The first few years are your discipline, because you need this punishment. But then let's say you truly change. At some point you no longer need this discipline. Our justice system periodically reviews you for just this possibility. A parole board. And what if they say you no longer need to spend time in jail for your own "correction"? Well, they let you go free. They reduce your time to time spent. But what of your debt to society (Catholic: debt to the moral order)? What about 'doing your time'? Musn't you be seen to pay the penalty for your crime or else people will get the message that "crime pays after all"? Ah, the parole board says that since you personally don't need the correction/discipline anymore...you are cleared from your personal obligation to pay it - which means you have been given an indulgence. An indulgence means someone else pays for it. The parole board says that there are plenty of other people in jail to show people that "crime doesn't pay." And there are plenty of good people doing good things to give people examples of how to live. So there is a 'treasure trove' of other examples to serve as positive role models or as cautionary tales to those who might be tempted to commit a crime. The parole board effectively draws from those in setting you free, forgiving you the rest of the sentence.
The Catholic Church would say the same - you have an indulgence and don't need the temporal punishment/discipline of incarceration because you have changed. So now you ask, what if the parole board gets it wrong and you have to stay in jail another year to your next hearing? Was the CC wrong to tell you that once your discipline was over, you would always necessarily be let free? Well, no. The CC doesn't teach that you'll always be freed. It teaches that you won't be receiving any more discipline/temporal punishment. You may need to stay in jail. Everything is ultimately in God's hands and in this case God wishes for you to stay in jail. But then...you are no longer suffering for your own sin, but you are bearing suffering that you did not merit. In this case, you are suffering so that others might know (by the moral order) that crime doesn't pay. Or perhaps like the movie The Shawshank Redemption God needs you there to help the incarcerated from the inside. What do we call it when you must suffer, not for any needed punishment/discipline for yourself, but for the sake of the benefit to others, and also for your own growth - we call it accepting our cross for us to carry.