Market Cap = Share Price x Shares Outstanding
Market cap is not the real price you pay for a company. If you buy the company and become its owner, you become the owner of the cash the company has, and you also assume the companys debt. The real price you pay is the Enterprise Value.
Warren Buffett uses the ratio of total market cap of all public traded companies over GDP to measure if the market is expensive. As of April 2012, the US total market cap is about $14.7 trillion, while the US GDP is about $15 trillion. The market was modestly overvalued.