Solution (source code)

= Solution

Take the upward <velocity> as positive during ascent. <Newton's second law> with <linear drag> gives
$$
\dot v+kv=-g,\qquad v(0)=v_0.
$$
Multiplication by the <integrating factor> $e^{kt}$ and integration give
$$
v(t)=\left(v_0+\frac gk\right)e^{-kt}-\frac gk.
$$
The maximum height occurs at the first zero of this <velocity>, hence
$$
\boxed{t_{\rm top}=\frac1k\log\left(1+\frac{kv_0}{g}\right).}
$$
Here $k$ has units of inverse <time>. The limit $k\to0$ gives $v_0/g$, and positive <drag> shortens the ascent relative to motion in a vacuum. The expression applies only up to the turning point; the <drag force> opposes the subsequent downward motion.