The answer depends on the period; are we talking about maximum capacity for a limited period–say, a few generations or centuries–or ultimate sustainable carrying capacity of the Earth?
Even given the technology of grain cultivation that gave rise to modern high density civilization, the current human population has unambiguously exceeded the natural carrying capacity of the Earth in terms of food production. The Haber–Bosch process, which binds atmospheric nitrogen into ammonia, is used to manufacture the artificial fertilizers that permit the large scale modern agriculture of the Green Revolution. This allows the nitrogen to be metabolically available for building proteins by plants and animals, including ourselves. To give a sense of scale, this process uses approximately 2% of the annual production of natural gas. Without the process of artificial nitrogen fixation, reserves of nutritionally available nitrogen (primarily from manure and guano) would not sustain current levels of agriculture. A similar limitation are naturally occurring phosphates.
Another fundamental limitation are natural sources of potable water. The statistics on water reserves for sustainable are less clear, as agriculture and industrial usage (especially steel and aluminum production, and textile manufacturing) compete for usage of water, and for many of these processes ‘grey’ (fresh non-potable) water would be usable. However, modern agriculture currently uses unsustainable volumes of ‘fossil water’ from underground aquifers well beyond rates of replenishment, and the overuse is actually compacting the aquifers so that they cannot carry the same future capacity. These aquifers are critical to the hydrological cycle which filters and mineralizes the water. The natural carrying capacity depends on how efficiently the water is used and recycled; currently it is mostly treated as a common resource, with the resulting tragic wastage, but efficient use could reduce waste in industrial and agricultural processes by at least half an order of magnitude.
Of course, one can posit some future technology that could replace both of these in a truly sustainable fashion; for instance, methane production from industrial agriculture and waste treatment could recapture nitrogen for use in the Haber–Bosch process without using non-renewable sources, and water can be filtered and cleaned for reuse by reverse osmotic processes. These would allow essentially infinite growth (subject ultimately to fundamental material resources and space for the population to live) but all of this takes more energy and (especially in the case of water) transportation to the user site, which places additional burdens on a fuel economy currently dominated by non-renewable sources.
This also depends on the lifestyle requirements of the population; currently, a small fraction of the world population enjoys the luxuries of urban society essentially without limit, and the rest of the world gets the cast-offs residue and lives in marginal sustainability. If the entire population of the world lived at the same quality of life and attendant wastage as North America and Western Europe (as many developing nations are currently aspiring to do) there would be extreme burdens on current resources, especially agriculture and fossil fuel usage.
For ultimate sustainability without assuming near-magic recycling and energy production technology, a population of somewhat less than one billion people living in modern urban lifestyle is probably a realistic estimate.
Stranger