The potential energy of a body at height h is mgh. Then its kinetic energy just before hitting the ground is
mgh
From the law of conservation of mechanical energy, the potential energy of a body at height h is converted into kinetic energy when it falls down. So, the magnitude of kinetic energy just before hitting the ground is equal to the potential energy at height h which is mgh.