You will be judged when you die, that’s called your particular judgement. You either go to hell, or heaven with a purgatorial stop first. When Jesus returns, he will judge both the living, and reaffirm and make public your particular judgement. The books will be opened, your works will be shown, and all of the results of your good and bad works will be made known. If you are already dead, your particular judgement will be confirmed. If you are living, you will be judged both particularly and finally at the same time.
What I’m not sure on is, if you are alive at the final judgement, will you then have to serve your purgatory/temporal punishment before taking part in God’s Kingdom on earth? If so, will you then die and serve your purgatory and then be resurrected?