Internal energy is the sum of all the energies in a system like kinetic energy of its molecules, potential energy, nuclear energy, etc.Only its change can be measured but absolute value of internal energy cannot be defined.
According to the First Law Of Thermodynamics,
(Note that thermodynamic work is different from work in physics)
For compression, where pressure increases,
So, when pressure increases i.e compression takes place, temperature increases