Answer
T = 6.75 seconds
Work Step by Step
Let $y_1$ be the height reached while the rocket is accelerating upward. Let $y_2$ be the additional height that the rocket goes up after the engines are turned off. Note that $y_1 + y_2 = 960 ~m$.
$y_1 = \frac{1}{2}aT^2$
We need to find the velocity $v$ at the moment when the engines are turned off.
$v = aT$
We can use this velocity to find an expression for $y_2$.
$y_2 = \frac{v^2}{2g} = \frac{a^2T^2}{2g}$
Now we can solve for the time T.
$y_1 + y_2 = \frac{1}{2}aT^2 + \frac{a^2T^2}{2g} = 960 ~m$
$T^2 (\frac{ag}{2g}+ \frac{a^2}{2g}) = 960~m$
$T^2 = \frac{2g(960~m)}{ag+a^2}$
$T^2 = \frac{(2)(9.80~m/s^2)(960~m)}{(16.0~m/s^2)(9.80~m/s^2)+(16.0~m/s^2)^2}$
$T^2 = 45.58~s^2$
$T = 6.75~s$