If the stone is thrown up vertically and return to ground, its potential energy is maximum
During the upward journey
At the maximum height
During the return journey
At the bottom
Potential energy = mgh
Potential energy is maximum when h is maximum