An urban heat island (UHI) is a significant anthropogenic modification of urban land surfaces, and its geospatial pattern can increase the intensity of the heatwave effects. The complex mechanisms and interactivity of the land surface temperature in urban areas are still being examined. The urban–rural gradient analysis serves as a unique natural opportunity to identify and mitigate ecological worsening. Using Landsat Thematic Mapper (TM), Operational Land Imager/Thermal Infrared Sensor (OLI/TIRS) and Moderate Resolution Imaging Spectroradiometer (MODIS), Land Surface Temperature (LST) data in 2000, 2010, and 2019, we examined the spatial difference in daytime and nighttime LST trends along the urban–rural gradient in Greater Cairo, Egypt. Google Earth Engine (GEE) and machine learning techniques were employed to conduct the spatio-temporal analysis. The analysis results revealed that impervious surfaces (ISs) increased significantly from 564.14 km2 in 2000 to 869.35 km2 in 2019 in Greater Cairo. The size, aggregation, and complexity of patches of ISs, green space (GS), and bare land (BL) showed a strong correlation with the mean LST. The average urban–rural difference in mean LST was −3.59 °C in the daytime and 2.33 °C in the nighttime. In the daytime, Greater Cairo displayed the cool island effect, but in the nighttime, it showed the urban heat island effect. We estimated that dynamic human activities based on the urban structure are causing the spatial difference in the LST distribution between the day and night. The urban–rural gradient analysis indicated that this phenomenon became stronger from 2000 to 2019. Considering the drastic changes in the spatial patterns and the density of IS, GS, and BL, urban planners are urged to take immediate steps to mitigate increasing surface UHI; otherwise, urban dwellers might suffer from the severe effects of heatwaves.