"If you aren't thinking about owning a stock for 10 years, don't even think about owning it for 10 minutes."

That's just one of Warren Buffett's many pearls of wisdom on investing, and given his track record, it pays to listen. Whether you're new to buying stocks or have been doing it for years, taking a long-term approach to investing is key. If you buy stocks with the intent to sell them shortly after the fact and cash in, you might lose a lot of money.

Here are a few basic rules that support a long-term investing strategy.

1. Only invest money you're sure you can part with for seven years or longer

The stock market is a volatile beast, and as such, you can't put money into it that you expect to need in the near term. If you're planning to buy a home in two years and you invest your down payment in the hopes of growing it into a larger sum by the time you're ready to sign a mortgage, you'll risk losing money if you're forced to liquidate your investments at the wrong time. That's why, as a rule of thumb, you should never invest cash you plan to use within a seven-year time frame. If you do, you may not have the option to think long-term with your investments.

Pile of bills

Image source: Getty Images.

2. Don't worry about getting the lowest price

A lot of investors employ the strategy of chasing lows -- buying stocks when they've bottomed out and can't get any cheaper. But that's a risky strategy, and it's also unnecessary if you're going to take a long-term approach to investing.

If your goal is to make money in the stock market, you shouldn't fixate on whether a stock will go any lower. Instead, ask yourself this: Will it go any higher? If the answer is yes, then you're in a great position to profit by buying that stock for a good price (but maybe not the lowest price) and then holding it for many years, during which time its value is apt to increase. Of course, this assumes you've done your research and you're sure you're buying a quality stock -- one whose business model you understand and whose competitive advantage is clear. But if you do the legwork and find stocks worth buying, you can make plenty of money even if the price you snag isn't the lowest.

3. Anchor your portfolio with well-diversified index funds

The goal of index funds is to match the long-term performance of their underlying indexes, and they don't charge the same fees (known as expense ratios) you'll find with actively managed mutual funds, which seek to beat the market. Warren Buffett is a big proponent of index funds, and they lend to a long-term investing strategy, so it pays to load up on those that offer exceptional diversification.

In this regard, an S&P 500 fund may be your best bet. That way, you're investing in a fund that's tracking and aiming to match the performance of the 500 largest companies trading on the market.

Learn from the greats

When Warren Buffett gives advice, it pays to listen. By taking a long-term approach to investing, you'll increase your chances of being successful at it. Just as importantly, you'll avoid some of the dangerous pitfalls so many short-sighted investors fall victim to.