You might be wondering if investing when the stock market is at or near its all-time high is a good idea. Before you decide, it's worth considering two factors: your risk tolerance and your investment time horizon. It's also worth looking at what has resulted from investing at previous all-time highs. Historically speaking, there has rarely been a bad time to put money to work assuming it's money geared for long-term investing.

Here, we'll go over some of the most important factors in deciding whether you should really be investing in the stock market right now. 

Your risk tolerance

Some people have an insatiable tolerance for investment risk: No amount of bitcoin tokens or GameStop stock is enough. For others, it's quite the opposite. No matter the type of investor you are, you should be evaluating risk from the standpoint of your total portfolio. That is, you should consider your entire financial situation and then assign risk from there. 

Next, realize that there are two key attributes of risk tolerance: your ability to take risk and your willingness to take risk. You might be a multimillionaire with an above-average ability to take risk, but you might not have the willingness to do so because you don't feel there's much to be gained as a result. In another case, you might have a very high willingness to take risk but have other obligations that prevent you from adopting such a strategy. Simply put, risk tolerances vary widely. 

There's also a psychological risk when it comes to investing: Some people literally can't sleep at night knowing their money is in danger of losing value. Stock market risk most famously comes in the form of volatility, or the tendency for investment values to fluctuate in either direction (at least in the short term). While it's somewhat in vogue to ignore the importance of being able to sleep at night, you'd be smart to exercise caution before you take on more risk than you can personally bear. 

Person looking over a growth chart on their tablet device

Image source: Getty Images.

Your investment time horizon

With regard to time horizon, you should only be investing money in the stock market that you won't need for at least three years -- some people even advocate five years as a minimum time frame. Regardless, if you're planning on using the money in six months for a down payment on a home or a large college tuition bill, you shouldn't be investing it in the stock market. 

One of the keys to determining your time horizon for various buckets of money is to create an asset allocation as part of a complete financial plan. You might start with an emergency fund -- money meant to cover short-term expenses in the event of job loss or other emergencies.

From there, you can build a portfolio of stocks, bonds, and other investments that reflects your ability to take risk over specific periods of time. Money in a child's education fund meant for use in several decades can be earmarked as a long-term account whereas money meant for a home renovation next year will require short-term management.

In brief: A long time horizon -- say, of at least five years -- is a sign you're ready for a stock market investment. 

What if the market is at an all-time high?

Bears beware: The fact remains that over long periods of time, the stock market has rarely lost money. If you had invested money at all of the previous all-time highs -- despite the crazy volatility often found in between -- you'd have come out ahead. You may have even come out very far ahead depending on the specific time period during which you began.

Investing now has a few important advantages. First, the sooner you invest, the sooner you'll be eligible to collect dividends, for example, and accumulate more shares. This is the very essence of compounding. Through compounding asset values, you'll be shocked at how fast your money can grow. 

Next, investing now will start your holding period for preferential long-term capital gains tax treatment. Long-term capital gains rates reward investors who have held stocks and bonds for over a year. Over time, you want as much of your income as possible taxed at as low a rate as possible -- the sooner you start investing, the sooner this will happen.

Invest, but have a strategy in place

The stock market -- without question -- can make you a very wealthy individual if you stick to the basics. Invest early and often, sell only when necessary, and focus on the long term. But before you do, make sure to take a thorough look at your entire financial picture and be entirely honest with yourself about your appetite for risk as well as your relevant investment time horizon. If everything checks out, proceed confidently and invest now.