Given,
The mass of the hammer, m=0.45 kg
The height of the shelf, h=1.7 m
The potential energy is given by,

Where g is the acceleration due to gravity.
On substituting the known values in the above equation,

Therefore the potential energy of the hammer is 7.5 J