To build lasting wealth with stocks, you want to look for companies with plenty of room to expand for many years. No matter how the stock performs in the near term, a company that grows its revenue significantly over decades will bring the stock along with it.

On that note, Amazon (AMZN -1.53%) and Roblox (RBLX -4.33%) have a lot going for them right now. Amazon still offers significant growth potential because of its leading position in the burgeoning cloud computing market. Meanwhile, Roblox is a popular interactive platform where younger audiences play games and interact with others. Here's more on why these stocks are promising investments over the long term.

1. Amazon

A massive selection of goods, fast shipping, and convenience have been hallmarks of the Amazon brand for over 20 years. The stock has been a truly wealth-building investment, but investors should never underestimate the ability of a great business to keep growing. The main reasons to invest in Amazon boil down to its opportunities in e-commerce and cloud services.

The company's technological roots building a superior online shopping experience have allowed it to branch out to other lucrative revenue opportunities like cloud computing. Spending on cloud infrastructure totaled $76 billion in the first quarter and grew 21% year over year, according to Synergy Research. Although Microsoft's Azure cloud service is gaining market share, Amazon Web Services is still the leader.

Though AWS has a higher profit margin, the retail side of Amazon is still the core of its business. Amazon's retail and related services generated $496 billion in total revenue over the last year, but that still leaves a lot of opportunity in the $6 trillion global e-commerce market -- based on eMarketer's estimate -- which is continuing to grow.

Analysts see the company's earnings per share growing at 23% per year over the next several years. Just as Walmart is still delivering returns for investors after 50 years as a publicly traded company, Amazon could very well be compounding shareholders' investment for decades.

2. Roblox

Investing in the growth of interactive entertainment is a good bet, considering the video game industry is expected to grow from $211 billion to over $600 billion by 2029, according to Statista. Consistent with that estimate, Roblox already has reached 77 million daily active users and is still growing.

The stock is trading well off its highs. That can be traced back to a high valuation following its direct listing a few years ago and slowing revenue growth in 2022. Roblox is clearly not immune to broader economic pressures on consumer spending, but the discounted share price could look like a bargain after another decade worth of growth.

Roblox offers a variety of games and experiences, including virtual music concerts, to attract people to the platform. It then looks to make money from offering virtual currency that is used to unlock premium content. It's also working on other ways to monetize players, such as welcoming brands to advertise on the platform.

Roblox's revenue has accelerated back above 20% in recent quarters, and management expects to grow the top line at least 20% per year through at least 2027. The growing selection of experiences available, such as home construction and other content that appeals to older players, is helping Roblox continue to attract more users and is why the stock should be a long-term winner.