Your time horizon matters when picking a stock. 

Gilead Sciences (GILD -1.15%), for example, gave investors five times the returns of Pfizer (PFE -0.12%) over the past five years. In 2016, though, Pfizer has handily outperformed Gilead. Which of these two stocks is the better choice for long-term investors now? It comes down to potential risk versus potential reward. Here's how Gilead Sciences and Pfizer stack up.

Image source: Getty Images.

The case for Gilead Sciences

A cursory look at Gilead's quarterly results in 2016 highlights one of the biotech's biggest risks. Sales for its hepatitis C franchise are declining -- a lot. If Gilead can't replace the lost revenue that it has come to expect from Harvoni and Sovaldi, the stock will likely continue to suffer.

That brings us to another significant risk for Gilead: its pipeline. Gilead recently canceled development of simtuzumab after the experimental drug didn't prove to be effective in the treatment of primary sclerosing cholangitis and nonalcoholic steatohepatitis (NASH). The biotech also halted clinical studies of GS-5745 as a potential treatment for Crohn's disease and ulcerative colitis.

So what's the investing case for Gilead Sciences? First, the company's HIV lineup continues to perform well. New HIV drugs Genvoya, Odefsey, and Descovy are taking off. Second, that hepatitis C revenue isn't going to totally fade away. Gilead's latest hep-C drug, Epclusa, made $593 million in its first full quarter on the market even though it hasn't received reimbursement approval from all major payers yet.

Third, Gilead still has a strong pipeline despite the setbacks. Regulatory approval for a new hepatitis B treatment is expected soon. The biotech plans to file for one more hepatitis C combo within the next couple of months. Gilead's pipeline also includes nine other late-stage programs plus another 15 in mid-stage clinical studies.

Last, and certainly not least, Gilead has the financial capability and desire to beef up its pipeline. As of the end of September, the biotech's cash stockpile totaled $31.6 billion (including cash and investments). Gilead's management team has stated that it would like to expand its portfolio, particularly in the oncology area.

In the meantime, Gilead continues to generate plenty of cash even with Harvoni and Sovaldi slipping. The stock trades at a ridiculously low earnings multiple. Gilead also pays a nice dividend with a forward yield of 2.59%. This all adds up to a pretty solid long-term argument for buying Gilead.

The case for Pfizer

Pfizer can claim two things that Gilead can't: Revenue is rising and so are earnings (at least on a non-GAAP basis). The pharmaceutical company still has its own risks, though.

Legacy established products continue to drag down overall growth. Sales are falling for older drugs like Lipitor, Premarin, and Norvase. Overall third-quarter revenue for legacy established products fell 7% compared to the prior-year period.

Pfizer also faces some challenges with drugs sold by its innovative health segment. Sales for its biggest moneymaker, Prevnar and Prevnar 13 vaccines, slipped slightly in the third quarter versus the same quarter last year. Blockbuster anti-inflammatory drug Enbrel, which Pfizer markets outside of North America, saw a year-over-year sales decline of 17% in the third quarter.  

Like Gilead, Pfizer has also seen a major pipeline setback. The company announced earlier this month that it was discontinuing development of its experimental PCKS9 cholesterol drug bococizumab. 

On the other hand, Pfizer has a lot going for it. Sales for cancer drug Xalkori are growing at a solid pace. Rheumatoid arthritis drug Xeljanz nearly doubled its sales in the third quarter compared to the prior-year period. And thanks to Pfizer's acquisition of Medivation, it will report sales for prostate cancer drug Xtandi in the next quarter. Not every successful drug in Pfizer's lineup begins with the letter X; the company's brightest rising star is cancer drug Ibrance. 

Pfizer's pipeline includes eight programs awaiting regulatory approval and a whopping 33 programs in late-stage studies. Another 17 are in mid-stage studies.

While Gilead looks to bolster its pipeline, acquisitions of Anacor Pharmaceuticals, Hospira, and Medivation have already done the trick for Pfizer. My guess is that the company could rest from major acquisitions for a while, although smaller deals won't be surprising.

Pfizer boasts of one of the better dividends around. The dividend yield currently stands at 3.92%. Although the company's payout ratio looks high, Pfizer's cash flow should allow it to keep the dividend payments flowing.

Better buy

I like Pfizer. I'd like it even more if the company's management had decided to spin off the legacy products as a separate business, but they chose to do otherwise. But although I like Pfizer, I like Gilead Sciences even more.

My view is that buying Gilead at the stock's current price nearly gives investors the pipeline for free. I expect Gilead to make some strategic acquisitions in 2017 (or earlier) that generate excitement. Like I said at the beginning: Your time horizon matters when buying stocks. If your time horizon is five years or longer, I think Gilead will prove to be the bigger winner.