At the start of Dragon Ball GT, Goku was turned into a kid by Ultimate Shenron when Pilaf accidentally said "I wish you were a kid again!" after stating Goku became way too powerful and he doesn't stand a chance against him now, but would if he were to be a kid again. (wish granted, goku turns back into a kid)
During his fight with Baby, Goku turned SSJ4 and with it, became so strong that the magic of Ultimate Shenron could not affect him anymore. This was stated in the anime. He was too powerful for Shenron's magic to affect him.
- After turning back into his base form, he became a kid again. He didn't go back to being an adult. So Ultimate Shenron's magic reasserted itself when he was no longer SSJ4.
At the very end of GT, we see the future. We see Pan being a very old lady, and a mini-goku and mini-vegeta fighting in the World Martial Arts Tournament. The mini-Goku was implied to be Pan's grandchild. Since we don't see them, we can assume that all of the Z fighters have passed away from old age. Goku is now walking around the tournament grounds, all grown up again in his base form, still having his tail (proving the wish wasn't reversed, because then his tail would have been gone) just before the end-credits come into play.
If the Goku we see at the end turned SSJ4, would he get old and die?
If Goku hadn't become a child and grown up again because of Ultimate Shenron's magic, he presumably would be dead of old age by the time of the finale just like everyone else is. But as we saw before, if he turns SSJ4, Ultimate Shenron's magic wears off and doesn't affect him anymore. So is Ultimate Shenron's magic the only thing keeping him alive? Without it, would he become old and die like he would have if it had never affected him in the first place?