Internal energy is the total kinetic energy and potential energy of all the particles in a system. Heating a system increases its internal energy. This does one of two things.
It can make the particles move faster. Their kinetic energy rises, so the temperature rises. The size of the rise depends on the mass, the material and the energy supplied.
Or it can change the state. The energy then increases the potential energy of the particles as they move apart. The kinetic energy does not change, so the temperature stays constant until all the substance has changed state. This is the flat part of a heating or cooling graph. The energy needed is called latent heat.