Since $\gamma$ is a loop, $\gamma(\alpha) = \gamma(\beta)$, and so $$\theta(\gamma(\beta)) - \theta(\gamma(\alpha)) = 0 \in \mathbb{R} / 2 \pi \mathbb{Z}.$$ Thus, for any lift $\tilde{\theta}$ of $\theta$, $$\tilde{\theta}(\gamma(\beta)) - \tilde{\theta}(\gamma(\alpha)) \in 2 \pi \mathbb{Z},$$ and so $$n(\gamma, a) \in \mathbb{Z}.$$