Depends on whether or not you were able to achieve a plenary indulgence, or only a partial indulgence. Plenary indulgences require complete detachment from sin. That’s pretty hard for us to manage. More than likely you would only be able to achieve a partial indulgence, and so would likely have some time in purgatory before going to Heaven.
That being said, why wait till your deathbed? There are a massive number of way you can earn indulgences throughout your everyday life, short prayers you can say with the intention of receiving an indulgence, mass attendance, adoration.
There’s no reason to leave this sort of thing to your deathbed. ^^