Here's the first thing Bill Gates did with his money after making over $350 million from Microsoft's IPO

Business magnate and Microsoft co-founder Bill Gates poses in November 1985 in Bellevue, Washington.
Deborah Feingold | Getty Images

When Microsoft went public in March of 1986, co-founders Bill Gates and Paul Allen, two friends from high school who bonded over their mutual love of computer science, became multi-millionaires.

Although Allen had left the company years earlier amidst health concerns, Gates, then 30, remained CEO and rose to prominence as one of the richest people in the U.S. The shares he sold made him $1.6 million, and the 45 percent stake he retained gained a market value of $350 million.

The young CEO celebrated his newfound wealth by making a very sensible decision: He paid off his $150,000 mortgage, he told Fortune in 1986.

That was a smart move, financial experts Kevin O'Leary and Suze Orman would say: Both encourage you to eliminate any debt, including a mortgage, as quickly as possible. "There's never an incentive to stay in debt," O'Leary tells CNBC Make It. "Life is unpredictable. What happens if you're laid off or incur unexpected expenses elsewhere? Your once-manageable mortgage is suddenly going to seem not-so-manageable."

And although Gates ended up wildly successful, nothing was guaranteed at the time.

Paying off his mortgage was also more practical than some of Gates's earlier decisions. In 1979, when he first started making big money off Microsoft, Gates bought a luxury car: A Porsche 911 supercar.

"I bought one thing that was a tiny bit of a splurge," Gates told David Rubenstein during a 2016 Bloomberg interview. "It was used, but it was an incredible car."

This $52M Ferrari GTO is a car only a multimillionaire can afford

Gates didn't let the car sit around gathering dust: The CEO loved to put its speed to the test in drives around the New Mexico desert, near where Microsoft was headquartered at the time. After one particularly raucous night, he even had to call Allen to bail him out of jail, according to a Time profile from 1997.

"Sometimes when I would want to think at night, I would just go out and drive around at high speed," Gates told Rubenstein. "Fortunately, I didn't kill myself doing that."

If you had invested $1,000 at Microsoft's IPO, here's how much you'd have now

Gates's wealth continued to balloon after Microsoft's IPO and he became a billionaire in 1987 at age 31. At the time, he was the youngest person ever to reach the milestone. And by 1995, his fortune had grown to $12.9 billion, making the then 39-year-old the world's richest man, a title he held for years afterward.

Today, with a net worth of around $95 billion, Gates is the second-richest person in the world, behind only Amazon founder Jeff Bezos.

With his wife, he now runs the Bill & Melinda Gates Foundation, a charitable organization he founded in 2000 after stepping down from Microsoft. The couple have pledged to give away the majority of their wealth throughout their lifetimes and are doing so by tackling major issues, including fighting Alzheimer's, providing resources to women in developing countries and promoting global health initiatives around the world.

Like this story? Subscribe to CNBC Make It on YouTube!

Don't miss:

Bill Gates: This is my biggest weakness
Related Video
If you had invested $1,000 at Microsoft's IPO, here's how much you'd have now