When looking at stocks to own over long periods of time that extend into decades, I think there's one overarching question that investors should ask: Will the business be relevant far into the future? Assessing the durability and staying power of a company should guide your buying decisions when thinking with such a big time horizon. 

Along the same vein, here are three stocks that investors could hold for the next 20 years. It's even more encouraging that Warren Buffett's Berkshire Hathaway has a sizable stake in all of these companies. 

Apple 

First on this list is none other than Apple (AAPL -0.35%). The iPhone maker posted revenue of $95 billion in the fiscal 2023 second quarter, down 2% year over year. While this was the second straight sales decline, thanks to softer macro conditions, it's obvious that one of Apple's defining traits is just how fanatical the company's customer base is. New versions of the iPhone, which are released usually every year, always see strong demand and carry high margins. 

There are currently over 2 billion active Apple devices, or what management calls the installed base. Apple has shown an outstanding ability to monetize this wide penetration not just with hardware revenue, but with its booming Services segment, which saw sales jump 6% in the most recent quarter. By getting customers ingrained in its platform, Apple benefits from high switching costs. That powerful ecosystem is why Apple has been such a successful business, literally printing tens of billions of free cash flow each and every quarter. 

A price-to-earnings (P/E) ratio of over 30 might be justified given this company's insanely loyal customer base and its incredible financials. With the probability likely high that this will remain a culturally important enterprise two decades from now, investors should take a closer look. 

Coca-Cola 

Having been around since 1892, Coca-Cola (KO) certainly has shown tremendous staying power. It has a leading (and growing) share in the nonalcoholic, ready-to-drink market. And there's no reason to believe that this won't continue. That's because of the company's strong global-brand recognition. Coca-Cola products are sold in over 200 countries, giving it broad reach that's hard to compete with on that level. 

Growth in this industry is hard to come by, essentially matching the expansion of the general population. But Coca-Cola does own a very diverse product portfolio that can cater to a wide range of consumer tastes. In 2019, the business acquired Costa Coffee, a coffeehouse chain that gives it exposure to another beverage niche. Management now estimates Coca-Cola's total addressable market to be a massive $1.3 trillion. 

The stock trades at a P/E ratio of about 26 right now. This is well below its 10-year average multiple. And if that valuation isn't convincing enough, Coca-Cola is extremely profitable, with an operating margin of 25.4% in fiscal 2022. That margin has expanded in the last five years. This allows it to return lots of cash back to shareholders in the form of dividends and share buybacks. 

Procter & Gamble 

When looking to buy stocks to hold for 20 years, Procter & Gamble (PG -0.78%) deserves some attention as well. Like Coca-Cola, P&G operates in an industry that doesn't invite much technological disruption. And this means that its popular products -- like Tide, Bounty, and Gillette -- will most likely remain staple brands used in households 20 years from now thanks to strong customer loyalty. 

That consumer relevance is absolutely critical to a company's lasting success. After all, if P&G products fall out of favor over time, then there's zero chance that the stock will perform well. But I don't think this will be the case. If these household products are working as intended, customers have no reason to change them. 

During the most recent quarter (Q3 2023, ended March 31), P&G registered revenue growth of 4%, driven by higher pricing. Buffett has spoken about how pricing power is his favorite business quality. P&G is proving that it has this wonderful trait at a time when inflationary pressures are a headwind for most companies. 

P&G shares are up 95% over the past five years, which outpaced the S&P 500's 54% gain. And income-seeking investors will certainly appreciate the fact that P&G has increased its dividend for 67 straight years.