Investigating the failure mechanism of solder joints under different temperature conditions is significant to ensure the service life of a printed circuit board (PCB). In this research, the stress and strain distribution of a PCB solder joint was evaluated by high- and low-temperature thermal shock tests. The cross-section of the solder joint after thermal shock testing was measured using a 3D stereoscopic microscope and SEM equipped with EDS. The microstructure of the lead-free solder joint and the phase of the intermetallic compound (IMC) layer were studied by XRD. The working state of the PCB solder joint under thermal shock was simulated and analyzed by the finite element method. The results show that thermal shock has a great effect on the reliability of solder joints. The location of the actual crack is consistent with the maximum stress–strain concentration area of the simulated solder joint. The brittle Cu6Sn5 and Cu3Sn phases at the interface accelerate the failure of solder joints. Limiting the growth of Cu6Sn5 and Cu3Sn phases can improve the reliability of solder joints to a certain extent.