Stocks are shares of a company. When you buy a stock you buy part of that company. For instance you can buy McDonalds stock (MCD) and become a partial owner of McDonalds. The value of the stock goes up and down based on what the company does and what people are willing to pay to own part of it.
The stock market is basically where stocks are bought and sold.
Here is a good article to help you understand why we have a stock market.