If you want to earn a big return but don't have a lot of money to invest in the stock market, you can make up for that by investing for a longer time frame. For example, if you could generate 10% annual returns or more, then over a 20-year window your investment could be worth more than six times what it is today. A $5,000 investment may grow to be worth nearly $34,000. And the longer you hang on, the more potential there could be for even greater gains.

The key is to target areas of high potential growth, where businesses will have plenty of opportunities to succeed. And there could be two potentially lucrative opportunities in diabetes care and artificial intelligence (AI). Here's how you might want to invest $5,000 to make the most of businesses involved in those industries.

Diabetes care

By 2050, there could be 1.3 billion people in the world with diabetes, effectively doubling from today. It's a concerning trend, and one that doesn't appear to be slowing down. That means the need to treat and manage diabetes is going to accelerate, creating growth opportunities for many healthcare companies

A couple examples of businesses that may experience surges in demand for their products include Tandem Diabetes (TNDM -0.90%) and Insulet (PODD 1.23%). Both companies make insulin-delivery systems that can help people manage their glucose levels. And over the years, both businesses have been thriving, generating impressive sales growth:

PODD Revenue (TTM) Chart

Data source: YCharts

While there are rivals and competing products, the massive potential opportunities within diabetes care should enable both of these companies to do well in the future. Tandem is the smaller of the two companies with a market cap of more than $2 billion (Insulet is almost $19 billion), but it's also the riskier option as its operations remain unprofitable. However, as these businesses grow, the potential is there for more revenue growth and stronger financials overall. 

The average price target for Tandem's stock is just over $50, implying an upside of about 55%. Insulet, meanwhile, may rise by 19% based on analyst expectations. And in the long run, both stocks could soar even higher.

Artificial intelligence

A huge opportunity for investors to earn a good return is in artificial intelligence (AI). But rather than jumping on some hot new AI stocks, a tried and tested performer such as Alphabet (GOOG 9.96%) could make for a better option. Alphabet's Bard chatbot may not be as popular as ChatGPT, but it does give the tech giant a way to develop and expand its next-gen technologies. 

Not only could the chatbot open up new opportunities, but AI should help deliver more growth for its already-successful assets in YouTube and Google Search. Alphabet is launching AI-powered search and ad capabilities that could help simplify its operations and provide more value for its users and customers.

In its earnings report for the quarter ended June 30, Alphabet's sales rose by just 7% versus 13% a year earlier. But that comes amid a softer ad market, and with businesses still hesitant to spend on marketing.

In the longer run, Alphabet could make for a solid investment as it benefits from the emergence of AI. Plus, with strong resources at its disposal to help fund more growth, it could potentially make some big moves to open up even more opportunities. Last quarter it generated more than $28 billion in cash from its day-to-day operating activities. And with cash and cash equivalents of almost $26 billion, it is already sitting on a sizable stockpile of money.

While there have been hotter AI stocks this year, if you're investing for decades, Alphabet could very well end up being one of the better buys in the long run. Its business is sound today, and there are many more growth opportunities ahead.