When they invest in the stock market, investors have several investment products available to them, and one of these products is shares.
The owner of a share is, therefore, the owner of a certain portion of the issuing company and has voting rights (such as the right to attend and vote at shareholders' meetings) and also economic rights (such as a share in any profits that the company may earn, through the dividends distributed).
An investment in shares has no definitive expiry date, it is not guaranteed, and the return (dividends and capital gains/losses) will depend on the performance of the company itself and the behaviour of finance markets.
A company's share price depends, firstly, on the performance by the business (any profits it has earned and any it is expected to earn, and its dividend distribution policy), and, secondly, on factors affecting the market or markets in which it operates (political, regulatory, economic stability etc.).