This breaks down into the formula I gave at the end of the session:
[(Number of years in the gap in campaign) ÷ (+per level from chart)]=Number of levels gained in the adventurer's life actively adventuring outside of game time.
So, an elf after 20 years would be 20/5 or 4 levels. Humans and half-orcs, the shortest lived races, get an assumed 1 level a year.
Note that you can't add extra xp from making items and scrolls and such to this, because that's included in stuff you'd make, but if you are going to make such a thing, it's assumed the one you have is going to be your best possible work, especially when you have 20 years to do it.
Before you get too hooked on those possible 20 experience levels, note that this XP includes any items you've acquired (not made) and you may want to bank some of that experience.
To get the xp amount that those levels correspond to, take the xp amount for the start of the new level you'd be if you took it all as xp, and subtract amount of xp you had before the gap in play.
So, if your new number is 150,000 and your previous # was 50,000, you'd have 100,000xp.
From that XP, you can bank up to half, or spend as much of it as you want on magic items, using the xp value in the DMG, or turn it into gold, at the rate of 10gp per xp.
[If your character was one of the ones who followed Rothbert and Darinna into Hell, you also got 100,000xp from that]
I have updated the experience charts in the core rules to show levels up to and exceeding 30. Note that these numbers aren't precisely the same as the ones in the high level campaigns supplements. If you don't have this, check your inbox.
Remember, higher levels bring higher responsibilities. You may want to choose to take a lower level and stay out of politics.