Long-term investors have been treated to an interesting few years in the stock market since the pandemic began. But great businesses with wide moats and solid forward-looking growth stories haven't gone anywhere. Even as investors are currently witnessing the long-awaited bull market, it's important to understand the market is cyclical.

Bad days will come and go, but the stock market has a consistent habit of not only recovering from those doldrums but steadily rising with the passage of time. For investors with the appropriate buy-and-hold time horizon, that's a compelling reason to put cash into fantastic companies and hold them for years no matter what the market is doing.

If you're looking for two stocks that have considerable growth potential in 2024 and well beyond, here are two names to add to your buy list.

1. Shopify

Shopify (SHOP 1.11%) continues to expand its share of the global e-commerce platform market while staying true to its core business: providing a full-service selection of software and hardware solutions for business owners online and offline. Of the top 1 million e-commerce websites globally, Shopify controls a whopping 30% share, more than any other provider and beating out well-known names like WooCommerce, Squarespace, and Wix.

Everyone, from fledgling business owners to massive brands, can access a monthly or annual plan that suits their individual needs. The most affordable Shopify plan, its Starter Plan, starts at a mere $5 a month. However, some larger brands choose plans that start at around $2,000 a month.

Thanks to integrations with strategic partners, the Shopify platform features more than 10,000 apps that make order and payment processing, back-office workflows, marketing, and fulfillment a straightforward process. Shopify's continued popularity with merchants, recent cost-cutting maneuvers, and price increases to its core subscriptions are rapidly improving its revenue, profits, and cash flow.

In the third quarter of 2023, Shopify processed $56 billion in gross merchandise volume (GMV), up 22% year over year, and revenue of $1.7 billion, a 25% hike from the year-ago period. Net income for the quarter totaled $718 million, compared to a net loss of $159 million in the same quarter in 2022.

Now, let's compare those GMV, revenue, and net income figures to the same quarter three years ago in 2020. In the third quarter of 2020, GMV totaled $31 billion, revenue $767 million, and net income $191 million. Those are respective three-year growth rates of approximately 81%, 122%, and 276%.

The third quarter of 2023 also saw Shopify mark its fourth consecutive quarter of cash-flow positivity. Free cash flow totaled $276 million for the three-month period, or 16% of revenue. Shopify seems to be on the right path, and that's a journey long-term investors might want to take part in.

2. Amazon

Amazon (AMZN 3.43%) is another e-commerce giant that has gone from strength to strength in recent quarters after a turbulent period. Ongoing concerns about the economy and changes in consumer spending seriously impacted the top and bottom lines in the aftermath of supercharged periods of growth during the pandemic.

Now, after a wave of strategic changes including multiple rounds of workforce restructuring, Amazon looks to be getting back on track. And even with these bumps in the road caused by a difficult macro landscape -- a reality that the company has encountered and overcome multiple times throughout its history -- this is a business that still boasts one of the world's top e-commerce platforms, a market-leading cloud business, and a host of other both mature and emerging business segments.

Looking at the company's financial results for the third quarter of 2023, Amazon reported net sales of $143 billion, a solid 13% bump from the year-ago period. It also brought in net income of $10 billion and operating income of $11 billion, representing respective year-over-year increases of 241% and 340%. Most of those profits came from Amazon's cloud business, which is significantly more asset-light and has higher margins than most of its other segments.

Free cash flow for the trailing-12-month period totaled $21 billion. Online stores still account for the lion's share of Amazon's net sales. Its flagship e-commerce business alone raked in $57 billion in the quarter, up 7% from one year ago. Amazon accounts for roughly 38% of all e-commerce sales conducted in the U.S. alone.

Its cloud business, Amazon Web Services, brought in net sales of $23 billion in the quarter, a healthy 12% increase from one year ago. The company is also widening its footprint in other markets including healthcare and entertainment. Its virtual healthcare segment Amazon Clinic, which is now available in all 50 U.S. states, continues to expand and offers services for more than 35 different patient conditions.

Prime Video isn't as significant a driver of the top and bottom lines as Amazon's e-commerce or cloud businesses. Still, as of 2023, Prime Video was the most popular subscription-on-demand service in the U.S., with a market share of 21% -- even coming in above Netflix and Warner Bros. Discovery's Max. Subscription services brought in $10 billion in net sales in the third quarter of 2023, up 14% year over year.

Amazon is also making headway in the artificial intelligence race, including with the introduction of its own AI-powered chips and its AI-powered productivity tool CodeWhisperer. When a business can continue to deliver impressive financial growth through the years and amid changing winds of consumer sentiment, all while maintaining a strong moat and foothold in its respective target markets, that's a stock you can buy, hold, and add to again and again. I would maintain that Amazon is one such stock. Investors may want to scoop up some shares in these early days of 2024.