When they say invest, the stock market is not the only investment destination.
You can invest in yourself to get a higher paying job, relationships, tangible assests and many other things.
The most important thing is making sure your money/asset is not lying fallow.
If you are in your 20s, you should invest.
If you are in your 30s, you should invest.
If you are in your 40s, you should invest.
If you are in your 50s, you should invest.
If you are in your 60s, you should invest.