If you're envious of people who've made fortunes in stocks such as Apple or Microsoft, remember that they generally did so by buying and hanging on to their shares for a long time. That's something you can do, too, and if you've picked companies that turn out to be long-term winners, you can make a lot of money.

Here are three companies that offer a lot of reasons to be hopeful that they will be long-term winners -- stocks you can buy and hold for the next decade -- or two.

1. Block

Block (SQ -2.28%) is the company you may have known as Square, and it's also the company behind many of those white payment contraptions lots of small companies use when they let you pay with a credit card. Block encompasses more than that, though; the digital payment specialist is home to not only Square but also Cash App, Spiral, TIDAL, and TBD.

In Block's third quarter, the growth stock's revenue grew by more than 17% year over year, to $4.5 billion, with gross profit growing 38%. The company refers to Square and Cash App as "ecosystems," as it has developed multiple services and functionalities within each -- Cash App, for example, is an app with an associated debit card available, too. Management noted, "Our Cash App ecosystem delivered gross profit of $774 million, an increase of 51% year over year ... "

Despite Block's solid growth rates and great growth potential, it has been whacked hard in the recent market meltdown, with shares recently down 71% from their 52-week high. That makes them especially attractive: Indeed, Block's price-to-earnings (P/E) ratio was recently 43, well below its five-year average of 118, and its price-to-sales ratio of 2.23 was well below its five-year average of 8.1.

2. Medtronic

Medtronic (MDT 0.37%), with a recent market value topping $105 billion, is a healthcare technology giant with more than 95,000 employees working in more than 150 countries: "Our technologies and therapies treat 70 health conditions and include cardiac devices, surgical robotics, insulin pumps, surgical tools, patient monitoring systems, and more." 

Medtronic clearly has plenty of room for growth as our global population grows and ages -- and on top of that, the company is continuing to innovate with new products and services. It's also planning to spin off its respiratory interventions and patient monitoring businesses into a new company. These are slower-growing operations and will leave Medtronic with faster-growing ones.

Medtronic has a compelling recent valuation, with a P/E ratio near 21, well below its five-year average of 35, and a price-to-sales ratio of 3.5, well below the five-year average of 4.5. Since falling stock prices cause dividend yields to rise, Medtronic's payout (which it has increased for 45 consecutive years) was recently 3.33%.

3. MongoDB

With a recent market value topping $11 billion, MongoDB (MDB -2.41%) is growing into a software powerhouse with a focus on databases. It recently boasted more than 37,000 customers in more than 100 countries, noting that its database platform has been downloaded more than 300 million times, with over 1.5 million registrations for its courses about its offerings.

The company's second quarter featured revenue up 53% year over year to $304 million, with revenue from its Atlas platform growing 73% and making up 64% of total revenue. It's worth noting that the company is not turning a profit at this point, which is likely keeping some investors away, but positive earnings are expected soon. Another concern has been rising interest rates and a possible slowdown in economic growth.

MongoDB's valuation has been looking attractive, with its price-to-sales ratio recently near 10.9, well below its five-year average of 24.6. That's still a steep level for a price-to-sales ratio, but it clearly reflects a big drop in price. Indeed, the stock was recently down nearly 72% from its 52-week high.

These are just three of many companies out there with great potential. Whichever ones you end up buying into, don't buy and then just hold blindly. Keep up with your holdings regularly to ensure that they're making progress and still seem to have great growth potential. Buy to hold, but be ready to sell if and when that seems smart.