In this study, ultrasonic surface rolling process (USRP) technology was used to prepare a diverse gradient microstructure in 17–4PH stainless steel. The treatment also induced various surface topographies and increased surface micro-hardness. Consequently, the tribological properties in 17–4PH stainless steel showed varying degrees of improvement through different numbers of USRP passes. With an increase of USRP process passes, there was a gradual decrease followed by an increase in the friction coefficient. These results indicated that surface roughness played a dominant role in reducing the coefficient of friction (COF), with the sample subjected to five passes of USRP displaying the lowest COF. Furthermore, 17–4PH stainless steel exhibited superior wear resistance after fifteen USRP treatments, wherein the strong gradient nanocrystalline structure and lower surface roughness contributed to the reduction in the wear rate.