Some penances can’t be done right away (like volunteering at a soup kitchen). But if the penance is one that can be done right away (like the one you were given), it’s best to do it then so you don’t forget and don’t have to worry about it.
Father edward_george1 above said that once absolved, you could receive communion and that having completed the penance isn’t necessary.
When I was growing up, the standard penance was X number of Our Father’s, X number of Hail Mary’s and X number of Glory Be’s. Those were and are easy to do wherever you are. If you’re told to do it before the Blessed Sacrament, your only options are to do it before or after Mass.
If you are truly bothered because you didn’t do your penance right then, maybe lack of time was your issue, you have 2 choices. Do your penance before Mass the next time you there so you can receive Holy Communion that day. Or you can refrain from receiving and add that to your list the next time you go to Confession.
Whichever you choose to do, always remember that we are given penances for a reason. And doing them helps us grow closer to Jesus.
Also, your priest isn’t going to give you a penance that you realistically can’t do. If there is a valid reason you can’t do the penance he assigns, explain your reason and ask for a different one. He’ll most likely oblige.