Used effectively, the stock market can be a money-making machine. Can it make you a millionaire? Yes. But to get amazing returns, you have to ignore all the near-term noise and keep your eyes focused on the long-term prize -- and by long-term, I mean decades.

To turn an initial investment of $10,000 into $200,000, we'll need 20-bag returns from our four stocks. Here are four high-growth names that can pull this off.

Dollar bill folded into an arrow point up.

Image source: Getty Images.

1. Doximity -- From $8.3 billion to $166 billion

Doximity (DOCS 0.52%) has established itself as the most popular internet portal for U.S. healthcare workers. Already, 80% of U.S. doctors and 90% of medical students use it. Doximity is where doctors go to find jobs, where pharmaceutical companies market their drugs, and where patients meet with their physicians online. It's also a profit machine, with a profit margin of 44%.

In effect, Doximity has stolen this slice of humanity from larger social networks like LinkedIn. And how big is this market vertical? Huge. U.S. healthcare expenditures were $4 trillion in 2020, and they're expected to grow to $6 trillion by 2028.

While Doximity estimates its total addressable market at $18.5 billion, the company has lots of optionality. When the pandemic hit, it rolled out a telehealth option, Dialer, which became an immediate hit. In a year, the company facilitated 63 million telehealth visits, a number that dwarfed Teladoc Health (TDOC 0.08%) and the rest of the telehealth universe. Doctors are an incredibly valuable audience -- so I expect Doximity's online dominance in the medical field to dramatically increase the value of this stock over the next 20 years, as the company finds new ways to monetize its users.

2. Innovative Industrial Properties -- From $4.2 billion to $84 billion

Innovative Industrial Properties (IIPR -0.92%) is the largest owner of cannabis facilities in the U.S., with 8 million square feet of growing space. Marijuana, of course, occupies an odd place in American culture right now. Growing, selling, and using it were crimes for many years, and it's still illegal as a matter of federal law. But a significant number of states have legalized it for medical use, adult recreational use, or both. In recognition of this, the federal government is largely declining to prosecute people in these states based on federal marijuana laws. Nonetheless, the criminal laws are still on the books. And because of those laws, traditional banks won't risk providing financial services to people and businesses in the marijuana industry.

Without access to standard financial services, how can a marijuana business acquire the cash it might need to operate and grow? One way, of course, is by selling stock in the public markets, and many businesses have done just that. But companies dilute investors' shares as more are issued, and that tactic has dragged down the values of many marijuana stocks.

Another option is to sell your production facility to Innovative, which will turn around and lease it back to you. More and more pot businesses have done just that. This is why Innovative has amazing profit margins of 55%, and it's still growing its revenues by almost 60% annually. And it's why this marijuana stock has crushed the market over the past five years.

IIPR Total Return Level Chart

IIPR Total Return Level data by YCharts

Over the next 20 years, I expect federal laws to change and marijuana will be completely decriminalized. Banks will be allowed to start providing financial services to cannabis companies. At that point, Innovative will become a boring (and very profitable) REIT with an amazing dividend.   

3. Unity Software -- From $21 billion to $420 billion

What will make Unity Software (U -0.92%) stock skyrocket over the next couple of decades? Part of it, of course, will be its gaming engine, which has been used to build vast numbers of mobile apps and video games, including the majority of the most popular mobile games. The digital gaming market made $175 billion in revenues last year, according to Newzoo.

Unity and Epic Games largely have a duopoly here: Most of this software is developed using one of their gaming engines. Unity makes money by providing tools to software developers and also by distributing games to various hardware platforms, including smartphones. Unity is projecting $1.5 billion in revenues in 2022 and expects to grow its top line at an annualized rate higher than 30% over the long term. If management is right, Unity's revenues will exceed $12 billion in 2030. If it can sustain that growth rate for the decade that follows, it will hit $140 billion in sales by 2040.

But what will really drive its growth are all the opportunities beyond gaming. Unity's software platform is used for 2D animation, but it can also produce 3D animation that looks like it was recorded with a camera. And Unity's advanced tools can be used for augmented reality and virtual reality apps. If augmented reality becomes as big a deal as Apple (AAPL -0.81%) CEO Tim Cook predicts, Unity investors will make out like bandits. 

5. Shopify -- From $54 billion to $1.1 trillion

Could Shopify's (SHOP 1.03%) market cap exceed $1 trillion one day? I think it's highly likely. It's a dominant tech player with a huge moat chasing one of the largest market opportunities in the world. E-commerce is already a $5 trillion market, accounting for about 20% of all retail sales.

It's been estimated that 95% of retail sales in the U.K. will be online purchases by 2040. So Shopify's market opportunity is not only huge, it's still increasing. Amazon (AMZN -1.11%) -- the top dog in e-commerce -- has a $1.5 trillion market cap now and accounts for roughly 40% of online sales in the U.S.

What Shopify is doing is providing the background tech to allow smaller players -- from mom-and-pop stores to multibillion-dollar businesses -- to compete with Amazon online. Millions of businesses are already on Shopify's platform. And using its tools and resources, they have made $200 billion in sales around the world.

Shopify's stock has taken a hit over the last several months as Wall Street has reacted negatively to the company's plan to spend $1 billion building out a warehousing network to help its customers with order fulfillment. I'm bullish on this move, though, as it comes right out of the Amazon playbook. All the retailers in Shopify's network are going to be delighted as they will have access to powerful fulfillment services while keeping their brands front and center. 

That's the opposite of what happens for those that use Amazon's network, which makes third-party sellers virtually invisible. Currently, 50% of Amazon's sales come from those third-party retailers. I think this warehouse expansion is a bold move by Shopify, and it's one reason why this company is going to be a dominant force as e-commerce grows over the next 20 years.