In this paper, the gravitational deflection of relativistic massive particles up to the second post-Minkowskian order by static and spherically symmetric wormholes is investigated in the weak-field limit. These wormholes include the Janis-Newman-Winicour wormhole, a class of zero Ricci scalar scalar-tensor wormholes, and a class of charged Einstein-Maxwell-dilaton wormholes. With the Jacobi metric approach, the Gauss-Bonnet theorem is employed to study the gravitational deflection. In this scheme, the deflection angle as a topological effect is considered. Moreover, we analyze the influence of the spacetime parameters on the results. PACS numbers: 98.62.Sb, 95.30.Sf