Forty years is a long time. But it's not an unimaginably long time. For many Americans, 40 years is roughly the length of time they will spend or have spent in the workforce.

Those years will end up being much more profitable for those who chose to invest early in their careers. That's why The Motley Fool frequently proclaims the benefits of investing as much as you can, as early as you can, and as frequently as you can. And solid stocks are a great place to put those investments -- stocks like Pfizer (NYSE:PFE).

Suppose you bought $10,000 of Pfizer stock in 1977. Jimmy Carter was president. Rod Stewart and Andy Gibb were topping the music charts. The years went by as you worked your way up the ladder. Forty years later, you're ready to retire -- and you still have your Pfizer stock. How much would it be worth today? 

Man wearing suit holding hands out with glowing image of dollar symbols over his right hand and glowing symbols of clocks over his left hand

Image source: Getty Images.

Congratulations, you're rich

Your $10,000 worth of Pfizer stock bought in 1977 would be worth, drum roll please, close to $630,000 in 2017. That shows the power of buying a great stock and holding on for the long run. But, as they say on the TV infomercials, "Wait, there's more!"

Pfizer paid out dividends throughout the 40-year period. If you had held on to the stock, you would have made a lot more money in dividend payments. If you had reinvested those dividends by buying more Pfizer stock, the difference in your total return would be huge.

PFE Chart

PFE data by YCharts.

Instead of having roughly $630,000 today, your investment would be worth more than $1.5 million. If you've ever questioned the wisdom of dividend reinvestment plans (Drips), hopefully the example with Pfizer will convince you how great they can be.

By the way, you could have actually been even richer than the previous numbers indicate. In 2013, Pfizer spun off its animal health business into a separate entity called Zoetis (NYSE:ZTS). Pfizer shareholders were given an opportunity to swap their Pfizer stock for Zoetis stock at a 7% discount. The total return for Zoetis in the following years has been twice that of Pfizer. 

Why Pfizer was a smart pick

Pfizer stock would have been a big winner for investors who bought in 1977 for two major reasons. Obviously from what we just saw, its dividends were a key part of the success story. It's hard to beat a solid stock that pays you to own it.

In Pfizer's case, the dividends grew for much of the 40-year period. The worst news during the time came in the midst of the Great Recession. Pfizer slashed its dividend in 2009. However, in subsequent years, the drugmaker increased its dividend to the point that it's back up to the previous high level. 

The other reason why Pfizer was a smart pick was that the company grew both sales and earnings. Pfizer accomplished this growth in a couple of ways. First, the company invested heavily in research and development. That R&D led to several big blockbuster successes, including anti-inflammatory drug Feldene, antidepressant Zoloft, and cholesterol medication Lipitor, the best-selling drug of all time by far. 

Pfizer also made quite a few strategic mergers and acquisitions over the past four decades. The two largest deals were the company's 2003 merger with Pharmacia and 2009 merger with Wyeth. Pfizer has kept up its acquisitions strategy, buying Anacor Pharmaceuticals and Medivation last year. 

A man holding a crystal ball with the word "Future" in yellow with years in smaller font on the ball

Image source: Getty Images.

Looking ahead to 2057

Could $10,000 invested today in Pfizer stock by a young person beginning his or her career turn into over $1.5 million 40 years from now? It's possible. The ingredients that made Pfizer successful from 1977 through now are still in place: solid dividends, commitment to R&D, and an active mergers and acquisitions strategy.

However, making that kind of return can only take place if you do three things. First, you have to buy the stock in the first place. Like hockey great Wayne Gretzky is attributed with saying, "You miss 100% of the shots you don't take." Second, you have to hold on to the stock. That can be hard to do at times. Pfizer went through several major declines in its stock price over the last 40 years. And third, you absolutely need to reinvest those dividends.

Whether it's Pfizer or another stock of a well-run company, following these three steps can make a huge difference in your investing performance. Maybe you won't have $1.5 million by 2057 -- but, then again, you just might make even more. 

Keith Speights owns shares of Pfizer. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.