The maximum height, ymax, can be found from: vy 2 = vy(0)2 + 2 ay (y - y(0)).
At maximum height, vy = 0, while y(0) = 0. Solving for ymax gives:
ymax | = |
|
= |
|
Alternatively, use:  vy(t) = vy(0) - g t.   At the maximum: tmax = vy(0)/g
Substitute into y(t) = vy(0) t - ½ g t2 to give ymax = vy(0)2/ 2g.
The maximum height is determined by: (i) the initial velocity in the
y-direction, and (ii) the acceleration due to gravity. Motion along x is irrelevant!