Over the past few weeks, I've heard from investors who feel that the stocks market may be near its top. Often these folks are feeling the need to delay putting more money in the market until after prices drop.

My answer is this: Don't try to time market; it doesn't work.

Investors should think of their money in two categories—short-term and long-term. Short-term funds are the money you plan on using within five years, to buy a house, pay college tuition or pay other expenses that are coming up relatively soon.

This money should not be in the stock market at all. The market is volatile, and it's especially risky over the short term. If you invest money that's earmarked for a home down payment next year, for example, you're being foolish. That investment could easily drop 10% or 20%, meaning you could end up in a much smaller house than you'd planned.

Short-term funds should be kept in a safe vehicle such as a money-market fund or short-term fixed income, even if it's earning minimal interest.

As for your longer-term money, some of it does belong in the stock market. It's very possible that the market will have a correction at some point. But over time, it has always gone higher.

When the Dow Jones Industrial Average passed the 1,000 level in 1972, people thought it couldn't go higher in their lifetime. By 1987, though, it had doubled. Today it's around 18,000. If you'd held off on investing based on market highs, you'd have paid a steep cost in lost opportunity.

Timing the market is hazardous because no one knows exactly when the market's swings will occur. If you had remained fully invested in the S&P 500 for the 10 years through 2013, you would have had a 9.2% annualized return. But if you were out of the market for the 10 best days during that period, those returns would plunge to 5.4%.

Another reason it pays to keep your money working in the market is the fact that dividend stocks will keep paying you regardless of how long it takes them to appreciate in price. I expect oil company BP to recover from its current troubles and for its stock to rise within a few years. But while we wait, we're being paid a nice dividend yield. Dividends make stocks prices' normal, week-to-week volatility a lot easier to handle.

Timing the market, even when the market seems richly valued, is never a good idea. It might work once or twice, but ultimately you'll miss some of the market's biggest gains. The best strategy for your long-term money: Invest smart in stocks that pay you for your patience.