The simplest rule is to invest early and often. The more you get into the markets early, the more you will have later. The time of your life. By this we mean the ages and stages of your life. Different types of investments fit different timeframes.
Stocks tend to make more money over time than other investments, but with a lot of volatility.
So the longer your time horizon, the more stocks fit your needs. You can take comfort in knowing that your portfolio can ride out at least a few market downturns before you even think about touching the money. On the other extreme, if you're saving to buy a new home or car next year, then you can't take the risk of losing your capital in a sudden market downturn. These investments offer limited return, but with almost no risk. Every penny will be there exactly when you need it, plus a little bit more.