No matter how old you are, no matter how wealthy you are, you should really have some money socked away in the stock market, Jim Cramer told his Mad Money viewers Tuesday, as he dedicated the entire show to generational investing, or how to handle your finances at every age.

Cramer said the stock market is still the best ladder we have for social mobility. Anyone who invests a decent chunk of their salary every year will be rewarded over the long term, bear markets and all.

In fact, from 1928 through 2014, the S&P 500 averaged a 10% annual return, including dividends. That may not seem like a lot, but 10% will double your money every seven years thanks to the wonders of compound interest. Or, put another way, if you invest $10,000 today, 40 years from now that investment could be worth $450,000.

That's why even a little money passively saved in the stock market can yield big rewards later in life, Cramer said.

Two Piles of Cash

Not all investments are created equal, Cramer told viewers. Every investor should have two piles of cash, one dedicated to retirement -- think 401(k)s or IRAs -- and another discretionary or "mad money" stock portfolio. Retirement should always come first and is invested conservatively, while the mad money portfolio can afford more risks.

How should investors get started? Cramer said your first $10,000 should be invested in an index fund or exchange-traded fund that mirrors the S&P 500. Once that goal is achieved, and you've maxed out your retirement accounts, you can then expand your investments to include at least five diversified stocks for your discretionary portfolio.

Use your youth to take risks and to speculate, Cramer added, because your long-time horizon will allow you to make up for losses. Back in 2005, Cramer recommended Regeneron  (REGN) , a development-stage biotech, at $5 a share. By 2015, just 10 years later, Regeneron topped $592 a share for a 9,900% gain. Gains like that, he said, cannot be had without rolling the dice a few times when you're young.

What About Bonds?

Do bonds have a place in your investment portfolio? That depends on your age, Cramer told viewers. It's no secret that interest rates have been historically low since the Great Recession, but that doesn't mean you should count bonds out altogether. Stocks are for capital appreciation, he said, while bonds continue to excel at capital preservation.

You'll never get rich owning U.S. Treasuries, but bonds are the closest thing to a risk-free investment that you will find.

As for when to own them, Cramer said no one under the age of 30 should ever own bonds. That is just a fool's game. In your 30s, however, he advised up to 10% of your portfolio can be invested in bonds. By your 40s, that number can increase to between 20% to 30%. In your 50s, between 30% to 40%. By the time you're ready to retire, 40% to 50% is appropriate.

Buy and Homework

Cramer's final lesson for investors is there's no such thing as "buy and hold," especially over the long term. He said "buy and homework" is the mantra investors should be reciting because every investment needs to be checked up on periodically.

When the markets are in decline, when the panic is setting in, that's the time when homework really shines, Cramer said. If you've done your homework, you'll know exactly what to buy when the markets are putting everything on sale.

Cramer noted when the markets dip by 10%, that's usually a good entry point to start picking among the rubble, assuming the markets are not in a full-on bear market.

If you're investing for the long term like famed investor Warren Buffett rather than for the short term like a hedge fund manager, you'll be able to discriminate between the stocks in the blast radius that are taking the markets lower, and those that are only receiving collateral damage.

Buying on the dips is only possible, however, if you take profits when the market rallies so you'll have some cash on the sidelines ready to buy on weakness.

Search Jim Cramer's "Mad Money" trading recommendations using our exclusive "Mad Money" Stock Screener.

To watch replays of Cramer's video segments, visit the Mad Money page on CNBC.

To sign up for Jim Cramer's free Booyah! newsletter with all of his latest articles and videos please click here.

Search Jim Cramer's "Mad Money" trading recommendations using our exclusive "Mad Money" Stock Screener.

To watch replays of Cramer's video segments, visit the Mad Money page on CNBC.

To sign up for Jim Cramer's free Booyah! newsletter with all of his latest articles and videos please click here.

At the time of publication, Cramer's Action Alerts PLUS had no position in the stocks mentioned.

More from Jim Cramer

Cramer: Amazon Will Be an 'Outsized Winner' When Consumer Trends Shift Online

Cramer: Amazon Will Be an 'Outsized Winner' When Consumer Trends Shift Online

You Need a Game Plan: Cramer's 'Mad Money' Recap (Friday 10/19/18)

You Need a Game Plan: Cramer's 'Mad Money' Recap (Friday 10/19/18)

GoPro, Eli Lilly, HealthEquity: 'Mad Money' Lightning Round

GoPro, Eli Lilly, HealthEquity: 'Mad Money' Lightning Round

Flashback Friday: Happy Anniversary, Black Monday

Flashback Friday: Happy Anniversary, Black Monday

Jim Cramer: With P&G You Want Single Stock Reward!

Jim Cramer: With P&G You Want Single Stock Reward!