For $h: J\rightarrow I$ such that $s=h(t)$, we use ' to denote $\frac{d}{dt}$ and $\cdot$ to denote $\frac{d}{ds}$. Then we have (\gamma\circ h)'(t)=h'(t)\dot{\gamma}(s) by chain rule. Therefore, we have \nabla_{(\gamma\circ h)'(t)}(\gamma\circ h)'(t)= \nabla_{h'(t)\dot{\gamma}(s)}\Big(h'(t)\dot{\gamma}(s)\Big) = h'(t)\nabla_{\dot{\gamma}(s)}\Big(h'(t)\dot{\gamma}(s)\Big)= h'(t)^2\nabla_{\dot{\gamma}(s)}\dot{\gamma}(s)+\frac{d}{ds}\big(h'(t)\big)\dot{\gamma}(s). Since $\gamma(s)$ is geodesic, $\nabla_{\dot{\gamma}(s)}\dot{\gamma}(s)=0$, which implies that \tag{1}\nabla_{(\gamma\circ h)'(t)}(\gamma\circ h)'(t)=\frac{d}{ds}\big(h'(t)\big)\dot{\gamma}(s).
Therefore, if $(\gamma\circ h)(t)$ is geodesic, i.e. \nabla_{(\gamma\circ h)'(t)}(\gamma\circ h)'(t)=0 if and only if \tag{2}\frac{d}{ds}\big(h'(t)\big)=0. Integrating it, we have h'(t)=a, which implies that $h(t)=at+b$ for some constant $a, b\in\mathbb{R}$. Conversely, if $h(t)=at+b$ for some constant $a, b\in\mathbb{R}$, then $(2)$ is satisfied, which implies that the expression in $(1)$ is zero, i.e. $(\gamma\circ h)(t)$ is geodesic.