Warren Buffett has a lot of very useful insights when it comes to the Stock Market, and investing in general.
One of his most memorable insights is that he views stocks as gambling. Although he does all his homework and research before investing in any stock, Warren Buffett never attempts to make money in the stock market, he buys on the assumption that the stock market would the next day and not reopen for a period of 5 years.
My interpretation of this is that, you should only put money in the stock market which you could afford to lose. Or in other words, money which you can forget about having for the next 5 years or more. Then, when you suddenly remember that you have this money invested for over 5 years, it would be a good surprise that you have actually earned either from the value of the stocks you purchased going higher or from dividends given out buy the excellent companies whose stock you purchased.