if the ball didn't make it to the end of the journey, then it presumably ran out of kinetic energy, said energy, energy of movement, either being converted to potential energy, or to heat energy as the case may be.
Conservation of energy means that the total, often the kinetic plus the potential, is constant. One decreases and the other increases, and vice versa, so that they all add up to the same amount.
ball released from rest at top of a track will have zero initial velocity. ball at the top of the track will have a potential energy of mgh. ball's vertical height above bottom of track gives the potential energy.