If you have money you won't need for 10 years or more, the stock market can be a great place to put it. Of course, if you need it tomorrow, the stock market is probably way too risky.
If you start investing for retirement early, then you can let your investments run for decades. That's a situation where stocks are a good investing strategy.
You can use stocks for most of your portfolio, and history shows stocks offer an attractive return.
Of course, we can't take history for granted, so we recommend you diversify with bonds and real estate to manage risk over any period.
Don't forget to think long term, even if it seems like retirement is a long ways away.