If a stable particle in a quantum field theory (QFT) is enclosed in a box, its mass changes from its infinite-volume value due to the finite-size dependence of its self-energy (because virtual particles can "travel around a finite-size world"). Generalizing results of Luscher, we show how to express the leading large-volume corrections to the mass of any particle below threshold in terms of the scattering amplitudes of the theory. The mass shift decreases exponentially with the extent of the box, the decay rates depending on the "composite structure" of the particle in question. The proof is given to all orders of perturbation theory for an (almost) arbitrary purely massive QFT in any dimension. We also discuss the size of the error term with which the mass shift can be calculated, showing in particular that the error is substantially smaller in 1 + 1 dimensions. Our results are useful, for instance, in the study of (1 + 1)-dimensional massive QFTs. As a first application we compare our predictions for the finite-size mass shifts in several integrable scattering theories with numerical results, most of which we obtain using the "truncated conformal space approach".