Switching wells in high-temperature and high-pressure gas wells will affect parameters such as the temperature and pressure of the fluid in the wellbore. Dynamic monitoring of temperature and pressure is difficult, and wellbore temperature, pressure, and fluid physical parameters are coupled to each other. Obtaining them separately will lead to large calculation errors. In order to improve the prediction accuracy of temperature and pressure in high-temperature and high-pressure gas wells, Based on the temperature–pressure coupling algorithm, this study compares the advantages and disadvantages of nine classic algorithms based on the temperature–pressure coupling algorithm, considers the impact of high temperature and high pressure on the temperature and pressure of the gas wellbore fluid, and establishes an unsteady temperature–pressure coupling model for high-temperature and high-pressure gas wells under on–off well conditions. Comparing with the measured data, it is proved that the prediction accuracy of the unsteady temperature–pressure coupling model of high-temperature and high-pressure gas wells meets the construction requirements of switch wells. The established model is used to simulate the temperature and pressure distribution of two high-temperature and high-pressure gas wells under switching conditions. The analysis shows that the distribution of wellbore temperature and pressure under the switch on and off conditions is affected by the gas–water ratio, heat transfer coefficient, tube size, and gas well production. Among them, the gas–water ratio increased by 1.5 times, the wellhead temperature increased by 25%, and the wellhead pressure decreased is 7.68%; When the heat transfer coefficient is increased by 1.5 times, the wellhead temperature drops to 34.38% and the wellhead pressure drops to 2.29%. When the tube size is increased by 1.125 times, the wellhead temperature is reduced by 44.20% and the pressure is increased by 6.09%. When the production of gas well is doubled, the wellhead temperature increases by 40.79% and the wellhead pressure decreases by 2.29%. The results can be used as a basis for the construction of high-temperature and high-pressure gas wells.