When the stock market is soaring, it's easy to get into the buying mood. That's because we actually see investments bearing fruit right away. Even if some share prices are high, the sheer momentum of the whole market offers us confidence that those prices could climb even higher.

But when the stock market stumbles, our eagerness to get in on the action may disappear -- and quickly. All at once we ask ourselves how long the downturn will last. We even might doubt the recovery of certain stocks that, in better market conditions, seemed like sure winners.

This scenario is probably playing out for a lot of us right now. The S&P 500 Index slipped into a bear market this week, inflation has been galloping higher, and interest rates are on the rise around the world. Now the question is: Should you really buy stocks right now? Or is it best to wait a while longer? Let's find out.

The advantages of buying now

First, let's talk about the advantages of buying stocks now. A huge one is valuation. Many solid stocks have dropped to incredibly low levels. I'm talking bargain basement.

For example, high-growth electric-vehicle maker Tesla (TSLA -3.76%) is trading at 56 times forward earnings estimates -- down from more than 160 just six months ago. That's as measures like return on invested capital and free cash flow are climbing.

TSLA PE Ratio (Forward) Chart

TSLA PE Ratio (Forward) data by YCharts.

Another example is coronavirus vaccine giant Moderna (MRNA -0.87%). The company continues to bring in billions in revenue and profit, and today it's trading at only 4.6 times forward earnings estimates. That's down from more than 16 a year ago.

There are plenty of other examples across industries. Today, those stocks that were trading at much higher valuations a short time ago now are available at very reasonable prices.

Another reason to buy now is you avoid the risk of missing out on the eventual rebound. History tells us markets always bounce back. It's just a question of time. So your favorite players could rise at any moment.

Now let's talk about the one big disadvantage of buying stocks today -- and that's the risk that the market may fall even more. You might be able to get that stock you're interested in for an even lower valuation.

And what if stocks remain at this undervalued level for a while? Then you'll really have to wait to benefit from your investment. This is the reason some investors are hesitating to buy stocks right now.

The importance of long-term investing

Considering these points, what should you do? First, it's important to note that you only should buy stocks right now if you plan on investing for the long term. By this I mean at least five years.

This doesn't mean the downturn will last this long. This is the time horizon I always favor. That's because it gives a company time to recover -- if it happens to go through challenging times such as a period of high inflation. And it gives a company time to grow -- no matter what the economic situation.

As always, it's important to invest what you can afford to invest. That means you should also set aside funds for use in an emergency -- so you don't have to dip into your investments.

As for buying stocks, here's what I say: When you feel that a company's business is strong, future prospects are bright, and the price is fair, it's probably time to get in on that story. So right now could be the perfect time to buy certain stocks.

As mentioned above, share prices could decline further. It's nearly impossible to grab a stock at its lowest price. But if you invest for the long term, that won't really matter. You'll still benefit from your favorite stock's recovery -- and growth in the years to come.

All of this means we shouldn't fear bear markets. And any day can be the right moment to invest.