Investing in stocks might not make you rich overnight, or even over the course of a few years. However, buying stocks and holding them for a long time -- and letting the magic of compounding do its thing -- is a time tested way to grow your wealth over time. Not all stocks are created equal, though, and picking the right stocks to add to your portfolio is critical to the success of this strategy.

With that in mind, here are two top stocks that you can buy and hold for a long time: NeoGenomics (NASDAQ:NEO) and Facebook (NASDAQ:FB).

A cancer diagnostic company poised for growth

NeoGenomics runs a network of oncology-testing laboratories. The company offers genetic-testing oncology services to hospitals, pathologists, and oncologists, which help detect cancer earlier, thus significantly improving the patients' chances of survival. NeoGenomics also helps drugmakers through the clinical trial process. One of the healthcare company's offerings is helping pharmaceutical companies design proper studies to test their investigational drugs. NeoGenomics has easily outperformed the broader market over the past three years. 

NEO Chart

NEO data by YCharts

However, the company is currently facing headwinds because of the COVID-19 pandemic. During the company's first-quarter earnings conference call, NeoGenomics CEO, Douglas M. VanOort, said the following: 

In April, clinical test volume declined slightly more and was down between 25% and 30% year-over-year, although it has appeared to stabilize on a week-over-week basis. The volume decline is understandable. In many regions of the country, oncology practices reduced their hours of operation and postponed or canceled patient appointments. Similarly, many hospitals reduced surgeries as they devoted resources to COVID-19 preparations and urgent needs.

VanOort believes these headwinds are temporary, and once the ongoing public health crisis ends, the company's business should get back on track. And once it does, investors who buy shares of NeoGenomics now will likely be glad they did. With an aging population -- and an increase in cancer incidence -- the oncology testing industry is set to continue growing. According to NeoGenomic, this market will grow at a rate of 6% to 8% annually.  

Cancer cell.

Image Source: Getty Images.

As the leading oncology-testing company on the market -- which offers a breadth of test offerings that is second none -- NeoGenomics is well-positioned to profit from these trends. By buying shares of NeoGenomics and holding onto them for a while, investors can profit from these trends too. 

Facebook remains the king of social media 

Facebook's business has also been impacted by the ongoing crisis. The social media giant experienced a "steep decrease in ad revenue in March," according to the company's CFO, David Wehner. However, Facebook's ad revenue seems to have recovered: "We have seen signs of stability reflected in the first three weeks of April," said Wehner.

Also, Facebook's user base got a boost as a result of people being forced to stay at home. During the month of March, the company had 1.73 billion in daily active users, an 11% year over year increase, and Facebook had 2.6 billion monthly active users by the end of March, a 10% year over year increase.

And while the company does expect the increased engagement to decline once social distancing measures are pulled back, no other social media company boasts a network nearly as large as that of Facebook. Unless Facebook loses a large percentage of its users -- which seems unlikely -- the company will continue attracting advertisers on its platform. 

Further, Facebook has many other assets at its disposal, including Instagram, which is one of the most popular social media platforms in the world. Facebook launched Instagram Checkout last year, which allows Instagram users to purchase items directly from the app. 

This move likely helped increase advertising on Instagram, as retailers increasingly looked to reach customers on the platform -- and vice-versa -- because of the convenience Instagram Checkout offered. Instagram brought in about $20 billion in ad revenue last year, according to some estimates.

Thanks to its dominance in the social media space, Facebook will remain a juggernaut for a long time. Investors looking for stocks to park in their portfolios should take a serious look at this tech giant.