You've probably heard the phrase "think long term" more times than you can count. But doing is often a lot harder than hearing it. Investors can easily be distracted by temporary issues when a stock is floundering.

However, you can also lose sight of the big picture when a stock is performing well. Not every stock has what it takes to succeed for years and even decades, but some do. Here are three growth stocks to buy that could be massive long-term winners.

1. Alphabet

Early last year, some investors were wringing their hands over Alphabet (GOOG 9.96%) (GOOGL 10.22%). They thought the tech giant had missed the boat on generative AI. OpenAI, in their minds, was eating Alphabet's lunch. Fast-forward to today, and Alphabet stock has soared more than 60% over the last 12 months.

In retrospect, it's clear that Alphabet didn't miss the boat on generative AI at all. The company plans to soon launch Gemini Ultra, an AI model that outperforms the best AI systems currently available on 30 of 32 widely used benchmarks.

AI should provide a huge long-term tailwind for Alphabet's Google Cloud business. That will especially be the case if the company stays at the forefront of AI tool development. I don't think that will be too much of a stretch, considering the expertise in Alphabet's Google Deepmind unit and the company's overall research and development (R&D) budget of close to $40 billion.

Alphabet has another major AI-related opportunity with its Waymo self-driving car technology business. It's a leader in developing quantum computers. The company is even researching how to extend the human life span. Maybe the stock won't be a massive winner over the next 20 years, but I wouldn't bet against it.

2. MercadoLibre

Think back to mid-2022 when the stock market had fallen quite a bit. Growth stocks had been hit especially hard. MercadoLibre (MELI 3.09%) was one of them, with its shares plunging nearly 70% below its peak set in early 2021.

Those were only temporary headwinds, though. Over the last 12 months, MercadoLibre stock has soared close to 80%.

MercadoLibre isn't a household name in the U.S. but is well-known in Latin America. It operates the largest e-commerce platform in the region, with more than 50 million unique buyers.

There's still plenty of room to grow in the Latin American e-commerce market. MercadoLibre's top two e-commerce markets, Brazil and Mexico, are projected to expand by compound annual growth rates of 17% and 33%, respectively, through 2026. The company should have big opportunities in other Latin American countries, as well.

MercadoLibre has also leveraged its e-commerce platform to expand into adjacent markets and operates a large logistics business. Fintech is another key growth driver, with the company's MercadoPago digital payments products and services.

3. Vertex Pharmaceuticals

Vertex Pharmaceuticals (VRTX -0.06%) has been one of the rare stocks in recent years that perform well, regardless of what the overall market does. Its shares jumped more than 31% in 2022 when the major market indexes sank. The biotech stock was a big winner last year with the momentum carrying over into 2024.

I predict that Vertex will be even more successful in the future than it's been in the past. My main reason for this optimistic view is that the company is expanding into lucrative markets outside of cystic fibrosis (CF).

Vertex recently won U.S. approval for Casgevy in treating sickle cell disease. It awaits a second approval decision for the gene-editing therapy in treating transfusion-dependent beta-thalassemia. The big biotech expects to soon report results from late-stage studies of VX-548, a non-opioid drug targeting acute pain.

Peering a little farther down the road, Vertex has a good shot at launching the first therapy to treat the underlying cause of APOL1-mediated kidney disease. This disease affects more patients than CF. The company is also evaluating cell therapies in early-stage clinical studies that hold the potential to cure type 1 diabetes.