The best investors know that high-quality companies should be owned for the long haul. That typically means it's a smart idea to have a time horizon that spans several years, as opposed to trying to figure out what to do with your money over the next few weeks or months. A long-term outlook allows compounding to work its magic, which helps generate wealth.

With that perspective in mind, investors can look at historical winners to find potential future opportunities. Here's one monster stock investors should buy and hold for the next five years. Its shares have climbed a jaw-dropping 499% just in the past decade (as of Aug. 15).

A person looks at a trading app on a phone and a laptop.

Image source: Getty Images.

Dominating the internet

The stock investors should buy and hold for five years is Alphabet (GOOGL 0.27%) (GOOG 0.18%). This dominant internet enterprise owns Google Search, YouTube, Waymo, Chrome, Android, Google Cloud, and many other properties. It has billions of users and raked in $96 billion in revenue in the second quarter.

Thanks to all of its popular products and services, Alphabet has multiple sustainable competitive advantages that make up its wide economic moat. It's able to collect vast amounts of data that help improve the quality of its offerings. Network effects underpin platforms like Search and YouTube, with more users and usage leading to a better experience over time. And the Google brand is extremely powerful.

There are cost advantages at play. For instance, Google Cloud is able to leverage its investments in expensive infrastructure as it scales up revenue, leading to improving profitability. And this segment benefits from switching costs, as customers develop workflows and integrations that make it difficult to leave.

AI at the forefront

Alphabet is already a leader in artificial intelligence (AI). While investors still seem worried about AI's impact on the search business, it's worth mentioning that the AI Overviews feature now has 2 billion monthly active users. This search capability is also monetizing at the same rate as traditional search. The business also develops its own AI models under the Gemini name. And it makes its own AI chips called Tensor Processing Units.

Alphabet can only invest aggressively in AI initiatives because of its financial strength. Other companies wish they were so fortunate. Last quarter, the business generated $28 billion in net income, translating to a net margin of 29%. And as of June 30, Alphabet had $95 billion of cash, cash equivalents, and marketable securities on the balance sheet, substantially more than the $24 billion of long-term debt it carried.

This allows the leadership team to spend like there's no tomorrow. Alphabet now plans to have $85 billion in capital expenditures this year, up from a prior target of $75 billion just three months ago. That figure is expected to increase in 2026.

Past and future winner

Just in the last five years, shares of Alphabet are up 174%. That gain was propelled by diluted earnings per share (EPS) that soared between Q2 2020 and Q2 2025. While I don't believe investors should expect a similar share price gain between now and 2030, this still looks like a great buying opportunity.

The stock trades at a price-to-earnings ratio of 22. Not only does this multiple make Alphabet the cheapest of all the "Magnificent Seven" positions, but it's also a meaningful discount to the overall S&P 500 index. I think the company should be able to post double-digit EPS growth for the foreseeable future, with added upside from a valuation perspective.

Investors shouldn't hesitate to scoop up shares of Alphabet today. It wouldn't be surprising to see this monster stock double over the next five years.