With the pandemic still raging and the U.S. economy slogging along, it's harder than ever to plan out the next few months, let alone try to decide on what investments you should hold for the next two decades. But despite the current economic uncertainty brought on by COVID-19, now is still a good time to find great companies to invest in and hold on to them for the long term. 

Why? Because buying stocks, and holding onto them for years, is still one of the best ways to build wealth. Investors who are looking for a handful of companies that can go the distance should strongly consider Apple (AAPL 0.80%), Amazon (AMZN -0.55%), and Microsoft (MSFT 0.95%). Here's why. 

A pocket watch sitting on top of money.

Image source: Getty Images.

1. Apple 

A couple of years ago, the Apple naysayers were claiming that the company was done growing and its innovative days were over. But Apple has made a habit of proving others wrong and growing hand over fist while doing it. The company's stock has grown 145% over the past 12 months, the tech giant has a market cap over $2 trillion, and the company has several important revenue segments that are seeing fantastic growth. 

Apple's total revenue increased 11% in the third quarter, and its earnings per share of $2.58 easily beat Wall Street's estimate of $2.07. Those are impressive results during a recession and pandemic, but it's not even the entire picture of the company's long-term potential. 

To understand where Apple is going, consider that in 2016 the company set a goal of doubling its services revenue by the end of 2020. The company achieved this in the third quarter, months ahead of schedule. Apple's services revenue jumped 15% to $13.2 billion. That growth comes from services including Apple Music, Apple TV+, Apple News+, and Apple Arcade. But those aren't the only irons Apple has in the fire. 5G technology could spur an upgrade cycle for iPhones, the company's wearable technology continues to dominate the market, and it's likely working on a pair of augmented reality glasses that could launch within the next two years.

All of this means that investors who are looking for a company that knows how to build on its past successes to propel it forward for the next 20 years should consider Apple's stock. 

Amazon driver in van and Amazon worker looking at smartphone

Image source: Amazon.

2. Amazon

Like Apple, some investors may think that Amazon's biggest growth days are in the rearview mirror, but the company's second-quarter results proved that's nowhere near accurate. The company's earnings per share of $10.30 easily blew past analysts' consensus estimate of $1.46 for the quarter. Additionally, Amazon's revenue jumped 40% to $88.9 billion, blowing past Wall Street's estimate of $81.56 billion.  

One of the key drivers of Amazon's current and future growth comes from its cloud computing company, Amazon Web Services (AWS). AWS revenue increased 29% in the quarter to $10.8 billion, and the segment is Amazon's biggest profit generator, with $3.4 billion in operating income in the quarter -- compared to $2.1 billion for the company's North American retail sales.

AWS is tapping into the growing cloud computing market that will be worth an estimated $167 billion by 2024, up from $73 billion last year. AWS has about 33% of the cloud computing infrastructure market, easily beating all of its competitors. 

The unique aspect of investing in Amazon is that the company has so many irons in the fire that it's sure to benefit from new markets in the coming years. Whether it's e-commerce, supermarkets, cloud computing, or smart home products, Amazon knows how to come up with new ways to get users further wrapped up into its ecosystem and grow its business. Amazon is the perfect stock for investors looking for a great long-term investment that has no problem thinking outside the box.

A building with Microsoft's name and logo in front of it.

Image source: Microsoft.

3. Microsoft 

Last, but certainly not least, is Microsoft. Why does this old tech giant deserve a spot on a list of stocks to hold for the next decade? To answer that, let's take a closer look at the company's most recent quarterly performance and its long-term potential in cloud computing. 

Just like Amazon, Microsoft is tapping into the massive cloud computing market through its Azure service. Azure follows AWS as the second-largest cloud computing company, with 18% of the market. With the cloud computing market being so large, there's plenty of room for both Amazon and Microsoft to benefit. Microsoft's Azure revenue rose 47% in the fiscal fourth quarter. There was already a trend of more companies looking to boost their cloud computing services, but the pandemic has accelerated this need and it's likely not reversing any time soon. 

Microsoft is growing aside from its Azure business as well, with the company's "more personal computing" segment sales increasing 14% in the quarter, the productivity and business segment growing revenue sales by 6%, and total revenue jumping 13%. 

Microsoft's shares have risen 61% over the past 12 months, but there's likely much more room for this tech giant to grow. Microsoft still dominates the office software market with its Microsoft 365 offering, and its work collaboration service, Teams, has given Slack a run for its money. Microsoft isn't the same company it was 20 years ago, and that's a good thing. The company's pivot to the cloud means that it's perfectly positioned to lead in the tech sector for the next 20 years.