Horizontal well drilling technology is widely used in the exploitation of petroleum and natural gas, shale gas, and geothermal resources. The temperature distribution of wellbore and surrounding formation has a significant influence on safe and fast drilling. This study aims to investigate the temperature distribution of horizontal wellbores during circulation by using transient temperature model. The transient temperature prediction model was established by the energy conservation law and solved by the relaxation iterative method. The validity of the model has been verified by the field data from the Tarim Oilfield. The calculation results showed that the highest temperature of the drilling fluid inside the drill string was at the bottomhole and the highest temperature of annulus drilling fluid was at some depth away from the bottomhole. Sensitivity analysis of various factors that affect the temperature distribution of annulus drilling fluid were carried out, including the circulation time, the flow rate, the density of drilling fluid, the inlet temperature, the vertical depth, the horizontal section length, and the geothermal gradient. It can be found that the vertical depth and the geothermal gradient have a significant influence on the bottomhole temperature, and inlet temperature plays a decisive influence on the outlet temperature. These findings can supply theoretical bases for the horizontal wellbore temperature distribution during drilling.