The world's best investors often preach the importance of focusing on the long term. After all, Rome wasn't built in a day, nor were some of the greatest companies in America. 

The best stock market returns are often delivered over a period of decades, and investors who were fortunate enough to buy into the initial public offerings (IPOs) for stocks like Amazon (AMZN -1.64%), Apple (AAPL 1.27%), and Microsoft (MSFT 0.37%) had the opportunity to turn relatively small sums of money into life-changing fortunes.

An investment of just $1,000 in any of those three companies around the time of their IPOs could've made you a millionaire. But even if you don't own them yet, here's why it's not too late.

1. Amazon is the biggest name in e-commerce, but it hasn't stopped there

Amazon stock hit the public markets on May 15, 1997. It was seen as a speculative bet on the power of the internet back then because selling products online was still a foreign concept. Fast-forward to 2023, and Wall Street analysts estimate the company will generate a whopping $559 billion in revenue this year alone, and over 80% of that is likely to come from its world-leading e-commerce business. 

But Amazon never stopped innovating. It also leads the cloud computing industry through its Amazon Web Services (AWS) brand, which helps businesses migrate their operations online with hundreds of different solutions. That market could be worth $1.5 trillion per year by 2030 (according to Grand View Research), so AWS will remain a key driver of growth and profitability for Amazon as a whole for many years to come. 

That's not all. The company is building an advertising empire through its ever-expanding portfolio of digital assets, including its streaming platforms Prime and Twitch, its music platform, and, of course, its flagship website Amazon.com. Not to mention, it also has exposure to the electric vehicle industry through its passive stake in up-and-coming EV manufacturer Rivian Automotive

Amazon stock listed at a price of $18 back in 1997, but it soared so high at various points that management opted to conduct four stock splits (in 1998, two in 1999, and 2022) to ensure individual shares remained affordable for smaller investors. Therefore, $1,000 would've bought 55 shares of Amazon at its IPO, but you'd actually have 13,200 shares today with a cost basis of $0.075 per share. 

Since Amazon trades at $102.24 today, that represents a whopping 136,220% return. In dollar terms, your $1,000 investment would be worth over $1.36 million today. Thanks to Amazon's commitment to innovation and expansion, it's never too late to add it to your portfolio.

2. An Apple a day keeps the doctor away ... from your portfolio

Chances are that you, or someone close to you, owns an Apple product. More than 2.2 billion iPhones have been sold globally in the last 15 years, and an entire ecosystem of hardware and software products has been built around the smartphone. Apple stock listed publicly on Dec. 12, 1980, and the company has since become the most valuable in America with a $2.3 trillion market capitalization.

Apple is a quintessential consumer products company, and it delivers new hardware releases like clockwork, creating an upgrade cycle that gives customers a quick, easy, and predictable path to purchasing the next generation of devices. It's rumored to be entering new territory this year with the release of a mixed-reality headset, taking wearable technology to the next level. 

But Apple's services segment has attracted the most attention from investors over the last few years. It features subscription-based products like Apple Music, Apple News, and Apple TV, which generate recurring revenue streams at very high gross profit margins. Then there's Apple Pay, a digital wallet that enables consumers to shop online with their credit card details and personal data protected. The digital payments industry could be a $20 trillion opportunity as soon as 2026. 

Apple stock hit the public markets in 1980 at $22 per share, giving you roughly 45 shares for an investment of $1,000. But the company has since completed seven stock splits, so you'd actually have 10,080 shares today with a cost basis of $0.10 per share. 

Since Apple stock trades at $145.93 now, that translates to a return of 145,830%. In dollar terms, your $1,000 investment in Apple's IPO would be worth over $1.45 million! But that's not all, because Apple has paid a dividend in most years since 1987, so you'd have also collected $155,131 in dividend payments. 

Investors can expect Apple to continue dominating the consumer electronics space and entrenching customers into its ecosystem by adding more services to its portfolio, so there's no time like the present to buy in. 

3. Microsoft is gearing up for a future driven by AI

Microsoft has been a publicly traded company since March 1986, and it has grown to become America's second-largest company with a value of $1.8 trillion. While its flagship Windows PC operating system and Office 365 document suite are used by billions of people worldwide, Microsoft has also expanded into a range of other businesses.

Like Amazon, Microsoft's biggest growth driver over the last few years has been cloud computing. Its Azure platform serves businesses and ranks second in the industry to AWS, but it's delivering key integrations with OpenAI, the developer of the ChatGPT conversational platform, to create the future of the cloud. Microsoft invested $1 billion in OpenAI in 2019 and just followed that up with a further $10 billion as the company jostles for a leadership position in the artificial intelligence (AI) industry. 

It could be the key to Azure eventually overtaking AWS and also growing its Bing search engine to compete with Alphabet's dominant Google Search. 

Microsoft completed its IPO on March 13, 1986, at a price of $21, so your $1,000 would have bought 47 shares. But the company has since completed nine stock splits, meaning you'd have 13,536 shares today with a cost basis of $0.0729 per share. 

Since Microsoft stock now trades at $248.16, that represents a return of 340,311% -- in other words, your initial $1,000 investment would be worth over $3.4 million today! But it gets better because Microsoft has paid a dividend since 2003, so you'd have also collected $350,717 in payments. In fact, you'd still be receiving $36,817 per year. Not bad for a $1,000 outlay. 

Throughout its history, Microsoft has been a safe bet on personal computing and the cloud, among other things. Now it's one of the best bets on the transformative potential of AI, which is why investors should buy the stock for the long run.