How much time are you willing to invest researching various investment opportunities?
There are two predominant theories about stock market valuations. The first says that a stock is only worth however much someone else is willing to pay for it. Believers of this theory look at charts, trends, investor sentiment to decide how to trade next, and ignore earnings, cash flow, balance sheet and other valuation metrics. The second theory says that a company's stock is worth the discounted value of all future earnings/dividends. Stock analysts spend their time predicting future cash flows of a company.
There is some degree of truth to both theories, and they're constantly at work pulling stock prices in different directions. This is what makes it so hard to predict future stock movements, both by chartists and analysts. There's a famous quote: The market can irrational for longer than you can stay solvent.
Still, it is possible for Individual investors to make a few good market picks. If they focus on owning great businesses at a reasonable valuation, and keep them for the long term, that should ensure a handy return on investment. The problem, of course, is finding great businesses trading at reasonable valuations.
The core of any portfolio should be stable blue chip companies with a good dividend. Then, you can add small portions into funds that cover mid cap stocks, international stocks, real estate stocks etc. to boost returns. However, be wary of jumping into the hottest trend.
If you'd rather spend your time pursuing your professional or personal goals, you can still benefit from investing in equity. Over the past 80 years, the US stock market as a whole has returned 6-7% above inflation over long periods. Almost half of this comes from GDP growth, and the other half comes from dividends and stock buybacks.
When to buy: Timing can make a huge difference in stock market returns. Depending on whether you invested near the peak, or after a collapse, your return could vary a lot. Consider two scenarios, where your return over the next twenty years is 6% in the first and 18% in the second. The difference in return for a $100,000 investment would be $400,000 versus $6.2million! Of course, you never know if you're near a market bubble, or if the market is about to appreciate significantly. The simplest course of action is to invest regularly, no matter what the market does. You'll buy more shares at low prices, and fewer shares at high valuations.
When to sell: The best way to sell is to plan in advance. If you're investing for a goal 25 years away, you can start with all stocks, and when you get closer to your goal, gradually move that stock holding into debt and/or cash.