Famed investor Warren Buffett has said that his favorite holding period is "forever." In practice, that's a hard goal to reach, but a good way to start is by focusing on companies that have proven track records of success behind them. One quick and dirty way to figure that out is by looking at a stock's dividend history.

Procter & Gamble (PG -0.78%), ExxonMobil (XOM -2.78%), and Federal Realty (FRT -0.37%) are all standouts when it comes to their dividends. Here's why you might want to own these three "forever" stocks.

1. Procter & Gamble continues to innovate

If there's a secret to Procter & Gamble's success, it is most likely research and development. That's because the company's products are, largely, things that have existed for a very long time. What keeps them fresh is the innovation that allows P&G to say they are "new" and "improved." Those two words are incredibly valuable in the consumer staples sector.

The company's success is most clearly seen in the 67 consecutive annual dividend increases it has provided investors. That makes the company a highly elite Dividend King. But there's more to the story here, because not only has P&G used innovation to its advantage, but it also has industry-leading distribution and marketing chops. It's the type of company you buy and hold on to for the rest of your life. The problem is that it doesn't go on sale very often. Today's 2.6% dividend yield is about average for this stock, and the price-to-sales and price-to-earnings ratios are a touch lower than their five-year averages. It looks like P&G might be trading at a fair price, which is actually attractive when you know you are buying a great company.

2. ExxonMobil smooths out a volatile sector

International energy giant ExxonMobil has managed to increase its dividend annually for 41 consecutive years. That's actually pretty shocking, given that it operates in the energy sector, where oil and natural gas prices often rise and fall in dramatic, and swift, fashion. But the company is built from the ground up to withstand the swings so it can continue to reward investors for sticking around.

For starters, the company's business is integrated, which means it has exposure to the entire energy value chain. That helps to smooth out the ups and downs since some areas of the energy business tend to do well even as others are doing poorly. On top of that, ExxonMobil focuses on maintaining a strong balance sheet. Low leverage allows ExxonMobil to take on debt when times are tough so it can continue to support its business and dividend.

In all, it's a reliable way to add exposure to the volatile energy sector, which can provide valuable diversification for your portfolio. Although the stock is probably fully valued today, given its middle-of-the-road (historically speaking) 3.8% dividend yield, it would be a good stock to own even if you try to wait for a deeper pullback before buying it. In other words, keep an eye on it if even if you aren't willing to buy it today.

3. Federal Realty lets you bet on retail without betting on a retailer

The big claim to fame for real estate investment trust (REIT) Federal Realty is that it has the longest dividend streak of any REIT. It's also a Dividend King, with 56 years of annual increases under its belt. The company's focus is well-located strip malls and mixed-use developments. Unlike many of its closest peers, however, it has long focused on quality over quantity, owning only around 100 properties. They're very good properties, with higher average incomes and population counts within three miles of the property than its peers have.

What's really interesting here, however, is that Federal Realty doesn't really care what stores are in its properties, so long as they're doing well. The list shifts over time, as you might expect. So you can have exposure to the retail sector by owning Federal Realty without having to try to pick a retail winner, effectively placing all of your bets on one company. And you can collect a 4.4% dividend yield along the way. In fairness, the dividend yield has been much higher in the past, notably during recessions when investors tend to throw the baby out with the bathwater. So you might want to wait until there's a deep pullback before buying. But put it on your wishlist now so you actually pull the trigger when the opportunity to own it on the cheap arises again.

Hold for as long as you can

Procter & Gamble, ExxonMobil, and Federal Realty are all the types of stocks you cling to for life once you've added them to your portfolio. Right now, P&G and ExxonMobil seem at least reasonably priced if you don't mind paying full rate for a great company. Federal Realty is probably a little pricey. But even if you have a heavy value bias, you'll want to keep all three on your watch list. Every so often they do find themselves on the sale rack.