This study explores the impact of external pressure and high-temperature erosion on the physical and mechanical properties of granite, the geothermal well storage medium, during geothermal exploitation. Objectives include evaluating the effects of repeated heating and cooling cycles at different temperatures on porosity, permeability and mechanical performance, with a focus on confining pressure's influence on permeability. The results indicate that under water-cooling and ambient conditions, porosity and permeability increase with cycle repetition, whereas compressive strength and elastic modulus decrease. Notably, Group B's (water-cooled) mechanical performance surpasses that of Group A (room temperature cooling) when porosity is below 1.5%. However, with increasing porosity owing to thermal cycling, Group B's granite becomes inferior to that of Group A. Micro-computed tomography scans reveal a post-cycling granite pore structure dominated by horizontal cracks, with primary uniaxial compression damage in the vertical direction. Thermal cycling reduces crack paths and load-bearing capacity, diminishing granite's mechanical performance. This study offers insights into subtle interactions between cooling methods and porosity during geothermal energy exploitation. It provides valuable guidance for optimizing geothermal energy use and mitigating potential adverse impacts on rock integrity, laying a foundation for further research and practical applications in geothermal energy exploitation.