Shockingly, as far as I can tell this appears to be an open problem.
First of all, this is a purely group-theoretic question: the fundamental group of a compact manifold is finitely presented, and conversely every finitely presented group is the fundamental group of a smooth closed manifold, in every dimension $n \ge 4$. We can add boundaries by cutting out a small hole, which doesn't affect the fundamental group for $n \ge 3$. Furthermore the universal cover is noncompact iff the fundamental group is infinite, and Riemannian metrics always exist on smooth manifolds. So your question is equivalent to:
Does every infinite finitely presented group have an element of infinite order? Equivalently, does there exist an infinite finitely presented group all of whose elements have finite order?
According to this MO thread from 2011 this is open! Famously, it's known that there exist such groups which are finitely generated, by the Golod-Shafarevich theorem; examples include the Grigorchuk group and (much harder) Tarski monsters. This is related to the literature on the Burnside problem.
For positive results with further hypotheses on the group see this MO thread. The answer should be yes for compact manifolds in dimensions $n \le 3$, I think. If the universal cover is contractible (for example if $M$ is hyperbolic) then $\pi_1$ is even torsion-free.