Warren has made most of his money by buying companies with durable competitive advantages at good prices, and then holding those investments for a very long time. However, Warren does sell stocks under particular scenarios.
In the 1969, after the bull market of the 60's, stocks were trading at P/Es of 50 or better when Warren sold out of all his stock investments. He subsequently bought back when stock prices collapsed during 1973 to 1974. Similar to Warren's actions in 1969, he sold lots of stock in 1998 when P/E ratios of Berkshire's public stock holdings had once again climbed to 50 and higher.
One way to think about whether selling a stock makes sense, is to compare the per share earnings of a given company over the next 10 years, to what you could earn from a bond. This comparison method between stocks and bonds will help you stay focused on the business economics of the investment.
Another reason to sell an investment is if the business or environment changes such that the competitive advantage a company is no longer durable. With many companies, a shift in business or environment can be detected on the financial statements. However, with financial institutions, Warren cautions that it's nearly impossible to see impending disasters because of the ability of those institutions to hide problems.
A stock price reaching its target value is another reason to sell the stock. Warren invests in stocks when particular arbitrage situations are available, and in those cases, there is a clear exit price for the investment.