Let's say you came into $5,000. How would you spend it? A vacation? A top-of-the-line 77-inch OLED television? Perhaps some jewelry?

Of course, as rewarding as each of those purchases might be, it's unlikely that any of them will generate significant returns years from now. However, for those willing to invest for the long term, there might be far more than $5,000 a few years down the line.

So, let's look at three stocks begging to be bought and held for the long term.

Hand holding a 3d stock chart.

Image source: Getty Images.

1. Alphabet

First up is Alphabet (GOOG 9.96%) (GOOGL 10.22%). With a market cap of more than $1.5 trillion, Alphabet is already one of the largest public companies on Earth. Still, investors shouldn't sleep on its potential.

The company, which operates a powerhouse digital ad business built on its signature Google Search engine and related family of apps, generates a flood of revenue and profits. Over the last 12 months, Alphabet recorded $297 billion in revenue and $67 billion in net income.

What's more, analysts expect the digital ad market to continue growing for many years to come. Some estimates are for total digital ad spending to approach $850 billion by 2027 -- up from $640 billion today. In turn, Wall Street expects Alphabet to grow sales by 11% next year alone, with earnings growing at an even faster clip of 18%.

To sum up, Alphabet is poised to continue growing along with the digital ad market. And that's great news for investors, who would be wise to consider holding shares of this internet giant for the long run.

2. CrowdStrike

Next up is CrowdStrike (CRWD 2.03%), which provides cloud-based cybersecurity services. Like the digital ad market, cybersecurity is a rapidly growing sector. That's because the digital crime business is booming. 

As a result, organizations are racing to secure their digital assets. That means billions of dollars of investment in data protection, access management, and endpoint security, among other forms of cybersecurity.

CrowdStrike, which offers cloud-based security modules that utilize machine learning, stands to benefit as the cybersecurity market balloons in size. The company, which has a market cap of $41 billion, remains early in its lifecycle. As of its most recent quarter (the three months ending on July 31), it had generated $2.6 billion in revenue over the last 12 months. Quarterly revenue grew at 37%.

For investors willing to hold for the long term, CrowdStrike is a name to consider, as the cybersecurity market stands to grow for years to come.

3. Microsoft

Finally, Microsoft (MSFT 1.82%) rounds out this list of tech stocks worth holding for the long term. The company, which is now closing in on Apple as America's largest company by market cap, is on a roll.

Its most recent quarter (the three months ending on Sept. 30) was a masterpiece, and was highlighted by:

  • $56.5 billion in total revenue for the quarter, representing 13% year-over-year growth
  • $24.3 billion in cloud revenue, up 19% from a year earlier, and above analyst estimates
  • Completion of the company's $68 billion acquisition of Activision Blizzard, setting the stage for future growth of Microsoft's gaming segment

In addition, management noted that a stabilization of the personal computer market has led to growth in the company's Windows business, which had seen revenue steadily decline for more than a year.

Microsoft's numerous business segments are firing on all cylinders. The company's cloud, gaming, and even Windows segments have all proven resilient and show that Microsoft remains a name that long-term investors should keep near the top of their list of stocks to own.