Any system or body has energy associated with the matter in that body or system. It is available to it in terms of chemical, thermal, mechanical, electrical, gravitational, magnetic potential or kinetic energy. By using up or consuming this energy, a body performs work.
Heat is the energy that flows between a body (or a system) and its surroundings on the basis of difference in temperature. Heat flows from a body of higher temperature to a body or surroundings of less temperature.
Internal energy is the total energy that is stored in the body. It is often related to the temperature of the body and kinetic energy of the molecules in that substance. The chemical energy can be considered as internal energy of the body.
Generally potential energy and external kinetic energy of the entire body are not considered as internal energy.