Residual stresses’ magnitude generated by deposition, quenching stress, thermal stress operation temperature, and infiltration in the thermal barrier coating (TBC) of gas turbines was determined. A thermal barrier coating was manufactured by the deposition of two layers, CoNiCrAlY and yttria-stabilized zirconia (YSZ), on an AISI 304 stainless steel substrate. The CoNiCrAlY was deposited by using an HVOF gun and the YSZ by an atmospheric plasma spray (APS). The TBCs were heat-treated at 1250 °C, with a CMAS (CaO, MgO, Al2O3, and SiO2) attack with a concentration of 10 mg/cm2 for 6 h in order to evaluate the evolution of the state of residual stresses in the coating at a high temperature. Residual stresses were determined by employing the modified layer removal method for duplex coatings (MLRMDC), ANSYS Version R19.2, and the equations proposed by Noda et al. In the YSZ, the total maximum residual stresses were 139 MPa in compression, and in the CoNiCrAlY, the maximum residual stress was 214 MPa in compression. The factor that has the largest effect on the magnitude of residual stresses was the infiltration of the CMAS in the YSZ.