In some ways, investing is like baking. With baking, you mix ingredients and pour them into a pan, put the pan in the oven, and wait. If you do those things the right way, you should have something tasty. Similarly, if you invest in the right mixture of stocks and wait long enough to allow them to grow, you can end up with a sizable portfolio.

In both baking and investing, the quality of your outcome depends heavily on the ingredients you use and an adequate amount of time. Want $1 million in retirement? Here are three stocks to buy now and hold for decades.

1. Amazon

Two qualities make it much more likely a stock will be a big winner over the long run. First, it should have a strong moat. Second, it should have optionality (multiple ways to grow). Amazon (AMZN -1.45%) has both qualities in spades.

Arguably the biggest moat for Amazon is its network effect: The more customers and vendors use its e-commerce platform, the more valuable its platform becomes. However, that isn't Amazon's only moat. Its brand is a gold mine all by itself. Amazon enjoys economies of scale throughout its operations. And there are significant switching costs for customers using its Amazon Web Services (AWS) cloud platform.

The company is so big now that it isn't likely to deliver the same level of growth over the next few decades as it has in the past. But Amazon should still generate exceptional long-term returns thanks to its multiple growth avenues.

There's still plenty of room for Amazon's online shopping business to expand, with e-commerce making up only 15.4% of total U.S. retail sales last year. AWS' growth prospects remain impressive as companies deploy artificial intelligence (AI) apps in the cloud. Don't underestimate Amazon's ability to move into new markets, either.

2. MercadoLibre

MercadoLibre (MELI -0.42%) has quite a bit in common with Amazon. Its e-commerce platform also has a strong moat. So does the company's fintech business. Arguably the most compelling reason to buy the stock, though, is its focus on the Latin American market.

The combined GDP of countries in the region totals over $5 trillion. E-commerce penetration in Latin America is lower than in the U.S. And, as MercadoLibre correctly stated in a recent investor presentation, "[F]inancial services are ripe for disruption."

MercadoLibre is uniquely positioned to capitalize on the opportunities in Latin America. It operates the region's largest e-commerce platform, with a 28% compound annual growth rate in gross merchandise volume since 2016. The company's logistics network is the broadest in the Latin American market. Its fintech business is the market leader in Argentina, Chile, and Mexico, and the second-largest in Brazil based on monthly active users.

Also, MercadoLibre has a booming advertising business. It currently ranks No. 3 in digital advertising market share in Latin America.

3. Vertex Pharmaceuticals

Vertex Pharmaceuticals (VRTX -0.46%) is already a big biopharmaceutical company with a market cap of nearly $104 billion. I predict it will grow much larger over the next decade and beyond.

The drugmaker has achieved tremendous success with its cystic fibrosis (CF) therapies. However, Vertex's best CF treatment yet could be waiting in the wings: The company plans to file for regulatory approvals of its vanzacaftor triple-drug combo in mid-2024.

Vertex has already won regulatory approvals in the U.S. and the U.K. for its likely next blockbuster -- Casgevy. This gene-editing therapy provides a functional cure for both sickle cell disease and transfusion-dependent beta-thalassemia.

I'm most excited, though, about the rest of Vertex's pipeline. The biotech expects to soon file for U.S. approval of the non-opioid pain drug suzetrigine (VX-548). It recently advanced inaxaplin into late-stage testing in treating APOL1-mediated kidney disease, which could present a bigger market opportunity than CF. Vertex is also moving forward with clinical studies for therapies that hold the potential to cure type 1 diabetes.