If you're at the start of your investing journey, you should find a handful of stocks you can keep in your portfolio for the longest time frame you can conceive. If these stocks can keep pace with -- or exceed -- the growth of the market over the long term, you'll become richer and richer as time goes on. Of course, picking long-haul stocks that will stand the test of time is easier said than done. 

The three stocks I'll discuss today have some things in common that make them worth retaining in your portfolio forever. They're deeply established companies that have so many different products and services that they don't need to worry if they're out-competed in any single market. And they all pay highly reliable dividends, so if you hold their stocks for long enough, they might even pay for themselves someday.

Without further ado, let's dive into three stocks that are worth holding for as long as you plan to be in the market.

A stock chart trending upward is superimposed over two stacks of golden coins.

Image source: Getty Images.

Abbott Laboratories

Abbott Laboratories (ABT -0.03%) is a titan in the healthcare sector, producing a tremendous number of items ranging from pharmaceutical drugs to diagnostic tests and laboratory reagents. Incorporated in 1888, Abbott Labs has stood the test of time like few other companies. In fact, it has issued dividend payments without fail -- and increased them annually -- for more than 47 years. This means that Abbott qualifies as one of the Dividend Aristocrats, an exclusive club to say the least.

While Abbott's trailing dividend yield of 1.3% isn't lucrative, behind the S&P 500's average of 2%, the company's stock has grown steadily over its time on the market, expanding by more than 325% in the past 10 years alone. Similarly, though its profit margin just shy of 10% is nothing to write home about, it's been proven stable through thick and thin. Even if Abbott isn't among the most rapidly growing companies in the healthcare sector, it's certainly one of the anchors you can count on to appreciate in value over time. 

Thermo Fisher Scientific

Thermo Fisher Scientific (TMO -0.98%) isn't exactly a household name for members of the general public, but it's well known in the pharmaceutical and biotech industries. Thermo Fisher makes laboratory hardware, scientific software, biomedical research reagents, diagnostic kits, and a galaxy of similar products, many of which are the industry standard for their stated purpose. Because of how central Thermo Fisher's products are to the biomedical industries, the stock has grown by a shocking 828% in the past 10 years, doubtlessly buoyed by consistently rising revenues.

As with Abbott Labs, Thermo Fisher's trailing dividend yield of 0.19% is not particularly exciting, and many companies have a higher profit margin than its 14%. On the other hand, for a large company in a mature industry, Thermo Fisher's year-over-year quarterly revenue growth of 9.5% looks quite favorable. As long as laboratories need equipment and consumable supplies, Thermo Fisher will be there for them, which is to say that its business isn't about to dry up even though it has faced an ocean of hungry competitors for many years already.

SPY Chart

SPY data by YCharts

Walgreens Boots Alliance

With its army of more than 9,200 pharmacy retail locations and a growing set of clinical care stations, Walgreens Boots Alliance (WBA -1.18%) is the most widely visible company on this list. Like the other two healthcare titans mentioned here, Walgreens has a massive number of different products for sale, and its international operations ensure that it isn't exposed to significant downside risk from any single country. These factors make it stable, and they also lower the long-term risks of expanding into new product verticals and new countries. While it's true that the company's stock has struggled in the past few years, it's also true that Walgreens has rallied after other periods of underperformance. 

Because it has a massive base of retail locations and it sells a huge number of narrow-margin consumer goods, Walgreens has a very slim profit margin of 0.5%, and you shouldn't expect this to increase by very much over time. But that shouldn't scare investors, as Walgreens has successfully competed in this environment for decades. Likewise, Walgreens has a sustainable dividend with a trailing yield of 5%, but that may not increase by much. And that's OK -- Walgreens has an entire population of customers who are dependent on it for their pharmacy services, and even fierce competition hasn't stopped the company from persevering over time.