Given time, Rohan can muster about 12,000 riders, while Robb manages to muster 18,000 in a very short span of time. Gondor at its height stomps King's Landing. It seems likely that neither side would be able to assault the other and win. On the other hand, the vanguard alone of Sauron's army was larger than the King's Landing army, and even then they were only winning at Minas Tirith because of magic (Grond, the Witch-King and other Nazgul, etc.). Clearly Gondor lacks the military strength to assault King's Landing and win. Gondor probably has somewhere in the region of 30,000 soldiers distributed throughout the kingdom. The wiki also states House Lannister has a total of 60,000 soldiers, which I'll assume are all in King's Landing.
According to the wiki, King's Landing has 2,000 City Watch and the House Lannister guard.