Thermal energy gives the total kinetic energy the system possesses. It is used to determine the internal energy of such system. In a system it increases with increase in temperature. Hence there would be the greater speed in molecular motion in the system.
Heat Energy is the flow of thermal energy between two objects of different temperature whereas the thermal energy tells about how much is the transfer of energy due to temperature difference between two bodies.