The difference between temperature and thermal energy is that temperature measures the average kinetic speed of molecules and thermal energy is the total kinetic energy of all particles in a given substance. In other words, temperature measures the average speed of movement, and thermal energy measures the mass of a substance. Both temperature and thermal energy are made by the movement of particles.
When temperature increases, the speed of the particles also increases. At high temperatures, particles move faster and are farther apart. When a temperature is low, particles move slowly and are close together.
On the other hand, thermal energy is reliant on conduction and convention. Conduction is the transfer of energy from molecule to molecule when a substance is heated. Convection occurs when energy is transferred while the mass of a substance moves. Basically, conduction and convection create movement; the more movement of particles in a substance, the more potential thermal energy is produced.
An example of the way temperature and thermal energy work is how the sun heats air located above the surface of the earth. As the air becomes warmer, heat is transferred between molecules and kinetic energy is created which produces thermal energy. As the molecules move faster to transfer heat, the temperature also increases.