The stock market is the market for the trading of company stock, both those securities listed on a stock exchange as well as those only traded privately.
Although common, the term 'the stock market' is a somewhat abstract concept for the mechanism that enables the trading of company stocks. It is also used to describe the totality of all stocks, especially within one country, for example in the phrase "the stock market was up today", or in the term stock market bubble.
The stock market is distinct from a stock exchange, which is a corporation in the business of bringing buyers and sellers of stocks together. For example, 'the stock market' in the United States includes the trading of stocks listed on the NYSE, NASDAQ, and Amex, and also on the OTCBB and Pink Sheets.
Participants in the stock market range from small private stock investors to large hedge fund traders, who can be based anywhere. Their orders end up with a professional at the stock exchange, who executes the order.