Determining how boundary terms behave in a quantum field theory (QFT) is crucial for understanding the dynamics of the theory. Nevertheless, boundary terms are often neglected using classical-type arguments which are no longer justified in the full quantum theory. In this paper we address this problem by establishing a necessary and sufficient condition for arbitrary spatial boundary terms to vanish in a general QFT. As an application of this condition we examine the issue of whether the angular momentum operator in Quantum Chromodynamics (QCD) has a physically meaningful quark-gluon decomposition. Using this condition it appears as though this is not the case, and that it is in fact the non-perturbative QCD structure which prevents the possibility of such a decomposition.