Holding stocks for the long term is a great way to build wealth. But how long is "long term"? Today, in this fast-paced world we live in, the average holding period for stocks is measured in months. If you are new to investing, you are probably wondering: Can holding for a stock for years really pay off?

Let's take a look at your returns if you bought the upstart Texas-based commuter-jet service, Southwest Airlines (LUV -1.06%) at its initial public offering in 1978 and held it for the next four decades, till today. But first, a little history and insight into why this airline has been so successful.

Making air travel affordable

In June 1971, Southwest started service between the three largest cities in Texas -- Houston, Dallas, and San Antonio -- with three Boeing 737s, each with a seating capacity of 112. For the first four months of service, it averaged only 16 passengers per flight, about half of the number required to break even. But management kept the focus on its target market, and in 1973, the company turned profitable.

By the time it went public in 1978, its fleet had expanded to 13 planes that carried over 3.5 million passengers that year, with full-year revenue in excess of $80 million. It was still serving only the Texas market, but had a focused operational strategy that would allow it to expand profitably.

Large pile of crisp new $100 bills

A hundred dollars invested in 1978 is now a large pile of $100 bills. Image source: Getty Images.

In its 1978 annual report, it described operating principles that would lay the foundation of decades of profitable growth. To reduce complexity and keep costs down, Southwest standardized on the Boeing 737 aircraft. It focused on short-haul routes (less than two hours), low prices for customers, high utilization, and short turnaround times on the ground. Even though it was known best for low prices, it had a "warmth and personal concern basic in our service approach" that it also extended to employees. This winning formula is still in use today, rewarding both the company and its shareholders well.

Holding through four decades

Southwest's IPO shares were priced at $11 and first traded on the public markets on June 8, 1978. Let's assume you were able to buy nine shares at the $11 price, for a total of $99. How much would you have today? First, you need to adjust the number of shares you own, and the cost basis, to account for the 14 times the stock has split over its history. Think of stock splits like cutting a pizza: You get more shares (or slices), but the total value you have (the amount of pizza) remains the same, though each share (or slice) is worth proportionally less.

Adjusting for stock splits and keeping fractional shares, your initial $99 investment would now be about 2,703 shares with a cost basis of 3.7 cents each. Today the stock trades at around $57.50, which means you would have an incredible $155,422.

Let's just pause on that number for a moment: The amount you would have is 1,570 times your original investment. No wonder compounding has been called the "eighth wonder of the world."

But that's not all you'd have. The airline has been paying dividends since it went public, and allowing shareholders to reinvest their dividends to purchase additional shares.

Juicing returns with a Drip

Dividend reinvestment programs (Drips) give shareholders the option to automatically reinvest the dividends they receive, to buy shares at market rates without transaction fees. For a solid company in which you want to continue to build a position, this is a great set-it-and-forget-it way to go.

To make the dividend calculation easier, let's just look at the last 20 years, for which easily downloadable data is available. Over the last 80 quarters, from an original $99 investment, dividends have totaled $7,719. If you chose to reinvest these dividends with a Drip program, it would add 221.6 shares to your total, or $12,802. It's incredible that just the returns from the Drip portion of this investment returned more than a 100-bagger.

The incredible power of compounding

Any way you look at it, this is an example of how holding stocks of well-run companies for the long term can build tremendous wealth. Here's one last math fact to put a cherry on top of this investment sundae: The dividend check for those 2,703 shares is now $486.55 -- almost five times your theoretical initial investment -- and it comes every three months. Yes, holding a stock for years can really pay off.