NEW YORK ( TheStreet) -- "Investing is a lot like comedy," Jim Cramer told his "Mad Money" TV show viewers, "timing is everything." That's why he dedicated his entire show to go over the frequent errors that investors make when buying and selling stocks.

Cramer said that knowing when to buy and when to sell is one of the most important, and most frustrating, parts of managing your own money. That is likely the reason why there is an entire cottage industry of financial advisors that tells investors that it simply cannot be done, that they should just put their money into index funds and leave it there forever. But Cramer said that while index funds have their place, telling investors that they're the only way to make money is totally bogus.

Timing makes all the difference, Cramer explained. He said there's a big difference between buying stocks at the market peak in October 2007 and buying them at the generational bottom in March of 2009. There's a difference between buying stocks before the European financial crisis began to rule the world's markets, and after.

Cramer explained that one reason that timing the markets is so hard is that some of the best moments to buy are during the moments of greatest terror. He said that it's almost never the right time to sell when the markets are panicking. History has proven that whether it was the crash of 1987, the flash crash of 2010 or the attacks on 9/11, what worked best was to be prudent and not to panic.

Perhaps the only exception, noted Cramer, was the financial crisis of 2008. Cramer said he was widely criticized for telling investors to sell their stocks in October 2008, but with the entire financial world as we knew it on the brink of collapse, the call to sell proved to be the right one, and investors were able to side-step the additional 35% decline in the averages.

But other than that one special case, Cramer said that dumping stocks into a selloff is always the wrong move. "Keep your head, because you will get a better moment to sell," he concluded.

Not the End of the World

Continuing with his tips for investors, Cramer said that not every big decline in the markets signals the end of the world. That's why no matter what the crisis of the day, it's never a good idea to sell everything, as not all stocks are equally good or equally bad.

When bad news hits, Cramer told investors to look at the stocks in their portfolios and rate them on a simple scale. Stocks you rate No. 1, for example, could be the ones you believe in and are worth buying more as they head lower. Stocks in the No. 2 camp could be those that could be sold if you needed to raise cash. Meanwhile, the No. 3's could be those that are expendable and should be sold now.