If a planet is currently in the middle of producing resources, you cannot upgrade it. (This is to ensure you don't lose any of those resources!)

Otherwise, to upgrade a planet:

1. Harvest any resources it has finished producing.
2. Wait for the planet to be hungry.
3. Tap the upgrade button at the bottom to upgrade the planet.