This is a question I receive occasionally, especially after the market has rebounded from a steep loss. So let's get right to it and start with the important things to consider before you make any changes.
What is your current financial situation?
This is the first thing you should gather. Figure out your net worth, how much money will be coming in over the next several years, and then your percentage of stocks, bonds, and cash in your portfolio.
Timeline is important.
To make it through another bear market you need an average of three years wo make it through the downturn (although this seems to be much shorter in recent history). Any money you'll need to spend in the next three years should be in a cash or cash-like product. The problem is, those investments do not yield much today because interest rates are so low.
This is a good starting point though. I think cash for money you'll need in the next two years is safe. Bonds for money you'll need in 3-5 years and then stocks for five years or longer.
Don't make dramatic changes.
There is a reason why target-date funds are so popular - they take the guesswork and emotion out of retirement investing. They gradually shift you to cash and bonds as you get older, no dramatic changes at all. Treat your own investments the same. If you need to make a dramatic change because you are way off target on your plan, that is fine. Otherwise, try and rebalance yearly to your desired allocation. This is where an advisor can really help you out. Analyzing how off target you are and continually making the changes on your behalf which takes the emotion out of investing.
To sum it up.
Everyone is different (surprise)! Not only will your age play a factor but so will your tolerance for risk and your current financial picture. But to keep it simple: the money you need for the next two years in retirement should be in cash. Money you'll need in 3-5 years should be in bonds (but you can tilt to stocks if you have the risk appetite). Anything beyond 5 years should definitely be in stocks because retirees are living longer and you'll want to make sure your money will be there with you until the end.