At what level of theory? Is the planet still a solid ball with 99.9% of its mass unused in its depths? Are humans still 50-100 kg masses of biological metabolism, and not, say, programs being simulated on small computers? Not trying to be pretentious, but I think the question needs to be more specific.
Here's two soft limits.
The solar power incident on the earth is on the order of 10^17 watts -- harnessing more than this means creating structures much larger than the earth, at which point it's not really "the same planet" (most of the surface area would have to be non-planet). Humans metabolize on the order of 10^2 watts, just like desktop computers. So, 10^17/10^2 = 10^15 humans, one quadrillion,
Suppose instead the earth uses an energy source much more powerful than its surface solar power (e.g. fusion power). Then one limit is how much heat can be produced without temperature reaching impossible levels. Basically, heat rejection is by thermal radiation into space (no conduction); the power goes as T^4 [1]. Right now we're rejecting on the order of 10^17 W (same as the solar input -- it's balanced), at about 300 Kelvin. So without changing the surface environment drastically, we can't really go above 10^17 W. But if we're willing to do drastic terraforming -- living in underground air-conditioned chambers with Herculean heat pumps everywhere, leading to an uninhabited surface hotter than molten iron (the Great Radiator), you could push the limit above that. At a surface temperature of 3000 Kelvin (~2700 C), that's 10 times what it is now, so the thermal radiation would be 10^4 times = 10,000 times larger. We could reject 10^21 W, enough to power 10^19 humans. (Which would comprise 0.01% of the earth's entire mass! Bit like Hong Kong really.)