For projectile motion, the maximum height \( H \) and time of flight \( T \) are related to the initial velocity and angle of projection.
The maximum height is given by:
\[
H = \frac{v^2 \sin^2 \theta}{2g}
\]
where \( v \) is the initial speed, \( \theta \) is the angle of projection, and \( g \) is the acceleration due to gravity.
Let \( H_1 \) and \( H_2 \) be the maximum heights of the first and second balls, respectively.
The given condition is:
\[
H_1 = 8 H_2
\]
Using the formula for maximum height:
\[
\frac{v^2 \sin^2 \theta_1}{2g} = 8 \times \frac{v^2 \sin^2 \theta_2}{2g}
\]
Simplifying:
\[
\sin^2 \theta_1 = 8 \sin^2 \theta_2
\]
Thus:
\[
\sin \theta_1 = \sqrt{8} \sin \theta_2
\]
Next, the time of flight \( T \) for a projectile is given by:
\[
T = \frac{2v \sin \theta}{g}
\]
For the first and second balls, the times of flight are:
\[
T_1 = \frac{2v \sin \theta_1}{g}, \quad T_2 = \frac{2v \sin \theta_2}{g}
\]
Taking the ratio of their times of flight:
\[
\frac{T_1}{T_2} = \frac{\sin \theta_1}{\sin \theta_2} = \sqrt{8} = 2\sqrt{2}
\]
Thus, the ratio of their time of flight is \( 2\sqrt{2} : 1 \).