Investing in the stock market is one of the best way to get rich, if not the best ways to do so -- as long as you understand that it will typically take awhile. Stocks that increase in value 1,000%, or even 10,000%, generally take many years to do so.

If you have, say, $5,000 in your pocket and you're ready to invest it in some stocks (and to wait a long time for them to perform as you hope they will), here are three promising companies to consider.

1. Intuitive Surgical

Intuitive Surgical (ISRG -1.16%) is a very familiar name in hospitals, where more than 7,100 of its da Vinci robotically-assisted surgical systems have been installed in 69 countries. The company says that through 2021, more than 10 million procedures had been performed with its systems.

That certainly reflects solid growth for this company that was founded in 1995 -- and continues to grow. Its third-quarter results will be announced any day now, but in its second quarter, revenue increased by 4% year over year, and by 11% on a compound annual basis over the past two years. Its installed base of da Vinci systems grew by 13% year over year during the same quarter, while the number of procedures performed increased by 14%.

Notably, the company gets more than half its revenue not from selling its expensive systems, but from supplying its customers with instruments and accessories for them, as well as via servicing them. This is an attractive razor-and-blades business model: Once Intuitive sells the system, it sets itself up for a lot of recurring revenue.

It's also a competitive advantage, because once a hospital has a da Vinci system and its physicians are trained on it, it's less likely to switch. Meanwhile, the company is also expanding its offerings and the kinds of procedures that can be done with them -- and earning international approvals, as well.

2. Digital Realty Trust

Digital Realty Trust (DLR -0.50%) is a REIT -- a real estate investment trust -- meaning that it's in the business of buying a lot of real estate and then renting it out, while paying at least 90% of its income to shareholders in the form of dividends. REITs typically focus on one or a few niches, such as apartments, retail outlets, warehouses, storage units, medical facilities, and the like. Digital Realty Trust focuses on data centers.

You can probably already see the potential for this company, as both businesses and consumers continue to use more and more data. The company recently had more than 300 data centers in more than 50 metropolitan areas in 27 countries on six continents.

It's growing, too: In its second quarter, the company added bookings that were expected to generate $113 million of annualized rental revenue. Overall revenue was up 4% year over year, with CEO A. William Stein saying, "Customers are seeking to secure the capacity they require in advance of availability, as over half of our record development schedule is pre-leased, and tight conditions in many markets around the world are resulting in an improving pricing environment and rising occupancy."

Digital Realty Trust's stock was recently down some 48% from its 52-week high, making its shares more attractive. They recently traded at a price-to-earnings (P/E) ratio below 20, well under their five-year average near 83. Oh, and the company's dividend is rather appealing, too -- recently yielding 5.4%.

3. Amazon

Then there's Amazon (AMZN -1.11%), which recently ranked third in global brand value for 2022, according to Kantar BrandZ, with its name estimated to be worth more than $700 billion.

Many people might not fully appreciate the scope of Amazon, though, as it's much more than just a massive marketplace. It's a major cloud computing power with Amazon Web Services (AWS), which generated 16% of revenue in its second quarter, up from 13% a year earlier.

It also offers Fire, Alexa, Kindle, Ring, and Blink technology and devices, and it's working on its Project Kuiper, which aims to increase global broadband access via satellites.

Amazon's shares were recently off 40% from their 52-week high, though the company still carried a market value topping $1 trillion. Its price-to-sales ratio was recently 2.38, well below its five-year average of 3.85, reflecting a valuation lower than it has usually had.

Each one of these three companies is well worth considering for your portfolio. They're capable of growing considerably over the decades to come, and each will be reporting quarterly results in the coming weeks. Keep an eye on them and see if they would be a good fit for you. Whether you have $5,000 or something greater or less, these stocks could build wealth for you over the coming 20 years.