As explained by Bill Thurston, on a given Riemann manifold $(M,g)$ you may really have Morse functions with gradient lines of any length. However, as now you are asking for a bound in terms of the Morse function $f$, the following argument shows why lengths of all Morse trajectories (MT) are bounded, and how to get a quantitative bound provided you are able to evaluate simpler geometric quantities.

Thanks to the hyperbolic structure of the flow near critical points, any critical point $x$ has a nbd $U_x$ such that any flow line crosses $U_x$ in an arc interval, and the length of the arc interval is bounded above by a constant $c=c(f,g).$ In order to do this quantitatively you may use the Morse lemma. Also, if the $U_x$ are taken small enough, and assuming the flow is Morse-Smale, any flow line or MT can possibly meet them only in strictly decreasing order of the relative Morse indices: in particular, it can meet at most $\dim(M)+1$ of them. In conclusion, the contribute to the length of any flow line or MT inside the set $U:=\cup _ {x\in\operatorname{crit}(f)} U _ x$ is bounded by $(\dim(M)+1)c.$

Now consider an arc of gradient line $\gamma$ in $M\setminus U$ of length say $L$.You can (re)parametrize it with respect to arc-length on the interval $[0, L].$ It solves the ODE $\gamma'(s)=-\frac{\nabla f(\gamma(s))}{\|\nabla f(\gamma(s))\|},$ so this time the derivative of $f$ along $\gamma$ wrto $s$ is $\frac{d}{ds}f(\gamma(s))=-\|\nabla f(\gamma(s))\|$ and integrating you get

$f(\gamma(0))-f(\gamma(L))= \int_0^L \|\nabla f(\gamma(s))\|ds \geq L\\ \min_ {M\setminus U} \|\nabla f\| $.

In conclusion, for any gradient line or MT $\Gamma$, summing over the components of $\Gamma\setminus U$ and $\Gamma\cap U$ one gets this bound on the length
$$\mathrm{length}(\Gamma)\leq (\dim(M)+1)c + \frac{\max_M(f)-\min_M(f)}{ \min_ {M\setminus U} \|\nabla f\| }$$

(BTW, note that, as a consequence, you can reparametrize on $[0,1]$ all Morse trajectories so as to be Lipschitz of constant $C(f,g)$, and that by Ascoli-Arzelà these are therefore a compact set in the uniform distance).

[*edit*] A more realistic variant, from a quantitative point of view. If the flow is not asssumed to be Morse-Smale one can simply bound the first term (the contribute to the length inside $U$) with a bound $N$ on the number of critical points, times the constant $c$. This way the choice of the nbd's $U_x$ is only subjected to local properties (on the contrary, telling how small they have to be in order to ensure the mentioned monotonicity of the Morse indices, requires informations on global properties of the flow).

1more comment