The best way to build lasting wealth isn't a secret: It's all about buying and holding high-quality stocks. But exactly how long should you hold those stocks? Well, legendary value investor Warren Buffett once said his favorite holding period is forever, and those words are some of the best advice I've ever received.

A long-term mindset forces you to look past near-term market volatility and see the big picture. It also means you avoid the higher tax burden that comes with short-term capital gains. With that in mind, here are two stocks that I plan to hold forever.

A person smiles while looking at their tablet.

Image source: Getty Images

1. MercadoLibre

MercadoLibre's (NASDAQ:MELI) business plays into two pervasive trends: online shopping and digital payments. In 1999, the company launched its namesake marketplace across four countries in Latin America, and a few years later it debuted Mercado Pago, a fintech platform designed to simplify transactions for buyers and sellers.

Today, MercadoLibre operates across 18 countries in Latin America, where it has become the dominant e-commerce player by a wide margin. According to Web Retailer, the marketplace receives roughly 667 million monthly visitors, while second-place Amazon (NASDAQ:AMZN) receives just 169 million. One driving force behind this advantage is MercadoLibre's logistics business, Mercado Envios. This gives merchants access to discounted shipping and fulfillment services, simplifying the process for sellers and improving the experience for buyers.

Since its launch in 2004, Mercado Pago has expanded beyond the MercadoLibre marketplace, becoming the dominant fintech platform in Latin America. To address the high percentage of unbanked consumers, the mobile wallet can be loaded with cash deposits at convenience stores, then used to make purchases both online and offline. In fact, off-marketplace transactions now represent the majority of total payment volume.

MercadoLibre's strong competitive position in these high-growth industries has translated into impressive financial results.

Metric

Q2 2018 (TTM)

Q2 2021 (TTM)

CAGR

Revenue

$1.3 billion

$5.5 billion

62%

Free cash flow

$62.8 million

$182.4 million

43%

Data source: Ycharts. TTM = trailing 12 months. CAGR = compound annual growth rate.

Of course, strong past performance is great, but it's more important to consider MercadoLibre's future. And I think this statistic says it all: MercadoLibre saw 76 million unique active users during the most recent quarter (this is the number of people who used at least one of its services), but the company serves a population of 638 million. Put another way, just 12% of the regional population engages with MercadoLibre or Mercado Pago.

In the years ahead, as internet penetration improves and more consumers adopt digital solutions -- like online shopping and mobile wallets -- MercadoLibre should see explosive growth. In fact, I think this could be a $1 trillion company a decade or two down the road. And with a current market cap of $94 billion, that implies tenfold growth for this stock. That's why I plan to keep it in my portfolio over the long run.

2. Shopify

Shopify (NYSE:SHOP) makes e-commerce simple. Its software integrates numerous sales channels into a single back end, allowing merchants to manage their business across physical and digital locations from a single platform. Shopify also offers additional merchant services, including solutions for payment processing, marketing, and financing, as well as discounted shipping and fulfillment.

Last year, Shopify added integrations for Facebook Shops and Walmart, expanding the number of sales channels available to its sellers. The company also started accepting applications for the Shopify Fulfillment Network, a system of warehouses around the U.S. that will use artificial intelligence and mobile robots to help merchants deliver orders quickly and cost-efficiently.

Of course, Shopify has certainly benefited from the widespread adoption of e-commerce, but its merchant-first business model has also been a key growth driver. Shopify helps its clients operate their own storefront, grow their own brand, and build lasting customer relationships. As a result, its software now powers over 1.7 million businesses.

Metric

Q2 2018 (TTM)

Q2 2021 (TTM)

CAGR

Revenue

$853.6 million

$3.9 billion

65%

Free cash flow

($31.5 million)

$507.0 million

N/A

Data source: Ycharts. TTM = trailing 12 months. CAGR = compound annual growth rate.

As part of Shopify's growth strategy, the company is expanding further into international markets. Last year, it debuted Shopify Capital in Canada, bringing its total to three countries, and it launched Shopify Payments in Belgium, bringing that total to 17 countries. More recently, Shopify introduced its retail hardware in the U.K., Ireland, Australia, and Germany.

Another element of management's growth strategy is the Shop mobile app, which launched in April 2020. This tool helps drive repeat purchases for Shopify-powered businesses, and it allows consumers to discover and follow brands, make payments, and track orders. By the end of the second quarter, just 15 months after its launch, Shop already had 118 million users worldwide.

In short, Shopify has a strong competitive position and management is executing on a smart growth strategy. And like MercadoLibre, I think Shopify could reach a $1 trillion market cap in the next decade or two. That's why I plan to hold this growth stock forever.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.