A space-time Trefftz discontinuous Galerkin method for the Schr\"odinger equation with piecewise-constant potential is proposed and analyzed. Following the spirit of Trefftz methods, trial and test spaces are spanned by non-polynomial complex wave functions that satisfy the Schr\"odinger equation locally on each element of the space-time mesh. This allows to significantly reduce the number of degrees of freedom in comparison with full polynomial spaces. We prove well-posedness and stability of the method, and, for the one- and two-dimensional cases, optimal, high-order, $h$-convergence error estimates in a skeleton norm. Some numerical experiments validate the theoretical results presented.