In this paper, a numerical solution procedure is presented for the free and forced vibration of a piezoelectric nanowire under thermo-electro-mechanical loads based on the nonlocal elasticity theory within the framework of Timoshenko beam theory. The influences of surface piezoelectricity, surface elasticity and residual surface stress are taken into consideration. Using Hamilton’s principle, the nonlocal governing differential equations are derived. The governing equations and the related boundary conditions are discretized by using the differential quadrature method (DQM). The numerical results are obtained for both free and forced vibration of piezoelectric nanowires. The present results are validated by available results in the literature. The effects of the nonlocal parameter together with the other parameters such as residual surface stress, temperature change and external electric voltage on the size-dependent forced vibration of the piezoelectric nanowires are studied. It is shown that the nonlocal effect (small scale effect) plays a prominent role in the forced vibration of piezoelectric nanowires and this effect cannot be neglected for small external characteristic lengths. The resonant frequency increases with increasing the residual surface stress. In addition, as the surface elastic constant increases, the resonant frequency of PNWs increases, while the surface piezoelectric constant has a decreasing effect on the resonant frequency.