You may not realize it, but you're witnessing history right now. In more than a century, we've simply never seen the stock market bounce back from a bear market as robustly as it has over the past 16 months. Since bottoming out on March 23, 2020, the benchmark S&P 500 has gained a whopping 97%.

With gains like this, some investors might be hesitant about putting money to work in the market. But if history has proved anything, it's not when you put your money to work that matters. Rather, it's the quality of the company you buy and how long you hold onto your investment.

It's my belief that if you put $50,000 to work right now in any of the following five stocks, they'd help you become a millionaire by 2040, or perhaps sooner.

A clock superimposed on a fanned pile of cash in a person's hand.

Image source: Getty Images.

Sea Limited

Don't be turned off by companies with market caps north of $100 billion. Often, businesses that have large market caps offer sustainably strong growth and/or profitability. In the case of Singapore-based Sea Limited (SE -0.69%), it offers three exceptionally fast-growing operating segments.

For the moment, and likely the next few years, Sea's digital entertainment division will provide all of its positive earnings before interest, taxes, depreciation, and amortization (EBITDA). Sea's mobile games are clearly resonating with users worldwide who've been cooped up in their homes because of the pandemic.

Sea was closing in on 649 million quarterly active users (QAU) at the end of March, but more importantly had 12.3% of its QAUs paying to play. This pay-to-play figure is many multiples higher than the industry average. 

The more exciting long-term opportunity for Sea is its e-commerce platform Shopee, which has consistently been the most downloaded shopping app in Southeastern Asia. Shopee happens to be gaining steam in Brazil, as well. By targeting emerging markets with rapidly growing middle classes, Sea's online platform should deliver sustainably strong growth. For example, $12.6 billion in gross merchandise value (GMV) was purchased on its platform in first-quarter 2021, which is more GMV than the entirety of 2018.

Third, Sea has a nascent but quickly growing digital financial services operation. It ended March with more than 26 million people paying for mobile wallet services. Since many of the regions Sea targets are underbanked, it could become a key player in opening financial doors for tens of millions of consumers.

A decorated camper-trailer on a wooden deck covered by a lit canopy.

Image source: Airbnb.

Airbnb

Another large-cap stock that has the tools needed to turn a $50,000 investment into $1 million or more by 2040 is travel-and-hosting platform Airbnb (ABNB 0.10%).

What makes Airbnb so special is that it has the opportunity to disrupt two industries at once: Hotel and travel. Prior to the pandemic, bookings on Airbnb more than quintupled in a three-year period (2016-2019), from 52 million to 272 million.  What's more, the vast majority of people booking on Airbnb are finding the platform organically. This is to say that Airbnb's brand is sticky enough that it's not having to spend a boatload on advertising and marketing to bring in repeat business or new users.

Additionally, there are approximately 4 million hosts globally, per Airbnb. However, there are over 130 million households in the U.S., and very likely north of 1 billion worldwide. The company is still just scratching the surface of its hosting potential, and we're liable to see more hosts join as consumer demand picks up.

But perhaps the biggest opportunity for Airbnb is its Experiences segment. Utilizing local experts to lead activities opens countless new doors for Airbnb to take the reins and handle most aspects of users' vacations, from the transportation they take to the adventures they experience. Airbnb has "travel disruptor" written all over it.

A senior citizen using a laptop to have a virtual consultation with a doctor.

Image source: Getty Images.

Teladoc Health

Innovative healthcare stocks are also a good bet to make investors richer over time. Telehealth kingpin Teladoc Health (TDOC -2.91%) is one such company that has the capacity to turn a $50,000 investment into a cool $1 million in under two decades.

The beauty of the Teladoc operating model is that it's helping all facets of the healthcare treatment chain become more efficient. Virtual visits are almost always more convenient for people, and they make it easier for physicians to stay in contact with chronically ill patients. Being able to keep up on vital data for patients with chronic illnesses should lead to improved patient outcomes, and therefore less money out of the pockets of health insurers. Telemedicine is a win-win-win.

Teladoc's success is also a function of the rapid growth from applied health signals company Livongo Health, which it acquired in the fourth quarter. Livongo leans on artificial intelligence to send its subscribers tips that'll help them change their behaviors in order to live healthier. As of the midpoint of 2021, Livongo had 715,000 enrolled members with chronic illnesses.

This figure just scratches the surface, considering that Livongo aims to offer its services to patients with hypertension and weight management issues, in addition to its existing service for people with diabetes.

Though Teladoc is losing quite a bit of money now as it integrates the Livongo acquisition, virtual visits represent a key tool for the healthcare community moving forward. That makes it a good bet to significantly outperform over the long run.

Three people meeting  in front of a two-story residential home.

Image source: Getty Images.

Redfin

Technology-driven real estate company Redfin (RDFN -2.81%) is a mid-cap stock with large-cap aspirations that has all the potential to turn $50,000 into $1 million or more by 2040.

There's no question that saving money is important to virtually all homebuyers and sellers. One area where Redfin sets itself apart is on the cost front. Whereas most real estate firms charge up to a 3% listing/commission fee, Redfin's charge ranges from 1% to 1.5%, depending on how much previous business a buyer or seller has done with the company. Considering that the median existing home listed for sale in the U.S. in June cost $385,000, according to Realtor.com, we could be talking about $7,700 in median savings for a buyer and/or seller.

Just as intriguing are the myriad personalized services Redfin has offered. On top of creating virtual and 3D home tours during the pandemic, the company's Concierge and RedfinNow services are helping to take the burden off sellers. RedfinNow, which is available in select cities, purchases homes for cash, thereby removing the haggling and hassle that come with selling a home. Meanwhile, Concierge works with people on upgrades and staging that can maximize the value of their homes during the listing process.

It's no mistake that Redfin's share of U.S. existing home sales nearly tripled from 0.44% to 1.14% between the end of 2015 and March 2021. Look for this figure to head even higher as homebuyers and sellers find value in the Redfin platform.

Person using a Square point-of-sale reader at a checkout counter.

Image source: Square.

Square

A final company with the ability to transform a healthy pile of cash into a life-altering amount of money by 2040 is fintech stock Square (SQ -1.68%).

Square's foundational puzzle piece has long been its seller ecosystem. This is the operating segment that provides point-of-sale devices, analytics, loans, and other tools to merchants to help them grow their business. In the seven years leading up to the pandemic, Square's seller ecosystem saw annual gross payment volume (GPV) skyrocket from $6.5 billion to $106.2 billion. In 2021, GPV is on track for north of $130 billion, which is primarily a result of bigger merchants (as measured by annualized GPV) utilizing the platform.

While the seller ecosystem should remain a steady growth driver for Square, the true gem for the company is digital peer-to-peer payments platform Cash App. Cash App has consistently been the most downloaded payment solution in the U.S. for the past two years. Furthermore, monthly active users have more than quintupled since the end of 2017, from 7 million to 36 million.

The great thing about Cash App is that it gives Square a number of ways to generate revenue. On top of merchant fees, it can collect transfer fees to and from bank accounts, as well as investment fees/commissions. This includes the trading and exchange of the world's largest cryptocurrency, Bitcoin. By 2040, Cash App may well be the leading financial services app.