The best time to buy a stock will be different for every trader depending on strategy, timeframe, and risk tolerance.
For instance, the best time to buy a stock for a breakout trader will be just below or just above a resistance level. While the best time to buy a stock for a pullback trader will be at support.
Therefore, the best time to buy a stock on any timeframe regardless of your strategy, timeframe, risk tolerance, etc is at or near a support or resistance level with a clearly identified risk level. 9 times out of 10 this will be as close to support or resistance as possible. Buying in the middle of a range (support and resistance levels) is a sure way to lose 50% on a trade.
A breakout trader who buys at resistance will set there stop below the resistance level in case the breakout fails while a pullback trader will set there stop below the support level in case the support breaks. Remember, support and resistance levels are battlegrounds between buyers and sellers. At support, shorts are entering and longs are getting stopped out. At resistance, longs are scaling out or entering and shorts are entering or stopping out. If a resistance level breaks, longs enter and shorts stop out, resulting in a pop. If a support level breaks, shorts enter and longs stop out resulting in a pop to the downside.