For a back-of-the-envelope energy balance, I think we can make some basic assumptions:
The human brain is reasonably energy-efficient, and it is a difficult but feasible target for a machine to run at the same efficiency. We are a long way from that goal currently.
Similarly for human-body level activity for sensors and manipulating objects. This may be an over-estimate, but may compensate for a likely underestimate for running the brain. The two values are of the same magnitude, so it doesn't make a substantive difference for the kind of estimate we will make. In addition, we may want to have communications networks and other energy-expensive systems to create an environment for these brains to exist within, and we can use our body-equivalent budget for that.
Therefore we can guesstimate that we can run one machine for the same energy cost as one human at a personal level, but we have broken away from much of the need to have an ecological footprint (water, air, space for growing foodstuff).
Put aside an arbitrary percentage (say 50%) of energy for maintenance of the machinery, at all scales from minor repairs to the presumed chip-fabrication plants etc.
A typical human uses an average of around 100 Watts of power. Roughly 20 Watts of that is used directly by the brain.
A 20% efficiency solar cell could collect around 200 Watts of power per square metre. Halve that to 100 Watts for maintenance etc.
So very roughly we can run one of our robots for every square metre dedicated to collecting solar energy.
There is roughly 50 million square kilometres (each of which is a million square metres) of the Earth's surface currently dedicated to pasture or growing crops. This part of the surface is going to be suitable for our solar cells. We could maybe get more if we added deserts etc, but we know that the arable land can be settled by humans, therefore we don't have high costs for difficult repairs or damage from hostile environments - none of which we can really estimate.
So, in short I think roughly 50,000,000,000,000, or the equivalent of 7,000 times the current Earth population.
Of course this is a very rough estimate with many many assumptions. You could easily multiply or divide by 100 by adding some argument or counter-argument.