At the maximum height, all the kinetic energy will have been converted into potential energy:
mgh = 12mv2
v = y
gh = 12y2
h = y22g
Thus, the potential energy will be maximum at the height given by: y22g