The ball will have the greatest potential energy when it reaches its highest point. At this point, its height is maximized, which corresponds to the maximum gravitational potential energy. So, the correct answer is:
when the ball reaches its highest point.