When is work done equal to kinetic energy and when is it equal to potential energy?
When the body is moved in the same level, that is no height difference from the initial position then there is no PE so that at that condition, work done is always the KE or change in KE.
When there is no translational motion and only the height of the object is changed then there is no change in KE and work is stored as the PE only and or change in PE.