Always get enough upgrades to get yourself out of underdevelopment ASAP. This tax will bleed your treasury dry in short order. The ONLY time it's worth delaying is if the planet is if you want to get a tactical upgrade to spam defenses quickly. Otherwise always get enough population upgrades to prevent underdevelopment.
For the higher level upgrades, after undevelopment is dealt with, wait until your population is almost maxed out. Buying them immediately has no benefit so you may as well spend that money elsewhere and revisit the planet later with these kidns of upgrades. If you're using the Progenitor (which grants a temporary discount on planetary upgrades after colonization) then there might be a reason to buy these immediately, but in the early-game this is a bad idea since you need to divert your funds to more immediate investments that will pay off quickly.