The easiest way to do this is with target-date retirement funds. These guys take most of the work off your shoulders and are offered by most major investment firms. So what are they? In a nutshell, you pick the fund that will mature closest to when you anticipate retiring—so if you're 35 years old, you want to select a fund with a target date of 2030.Then, it will rebalance itself over time, so you're investing aggressively in more stocks, less bonds while you're young, and as you age, the balance shifts to more bonds, less stocks.
If you want a little more control, a general formula for balancing your portfolio is to subtract your age from 100. The resulting number is the percentage of your money that you should have in stocks. One other thing: Don't try to time the market. History tells us that this never works, and the best strategy is just letting your money ride. If you start making moves, there's a good chance you'll end up selling low and buying high, which is the opposite of what you want. The market always rebounds, so sit tight.