Stocks are simply shares in a company. When a company goes public it floats on the stock exchange it sells shares of the company in order to raise capital (normally to expand the business) these shares are known as stocks in the USA and shares in the UK.
If for example there are 10,000 shares (stocks) for a company and you buy 1000 of them for a specific price, you will gain or lose equity depending on whether the price per share rises or falls. If the company does well (makes a profit) and the shares are in demand the price will rise and you'll make a profit, if the price falls you'll make a loss when you sell your stock.
It also gets more complicated with dividends (payouts to shareholders if the company does well) and shareholder rights (ability to vote and attend meetings etc.) if you hold a certain amount of stock.