Internal energy, $U$, is the total energy contained in a thermodynamic system. However, absolute internal energy is hard to determine, and even relative internal energy and changes to internal energy are hard to determine. Here's why:
Changes to internal energy usually occur through heat transfer $q$ or work done $w$. There are other ways to transfer energy also (like radiation), but these two are common. Thus,
$$dU = q + w$$
The heat transfer can be determined easily by calorimetry, where $q=cdT$, where $c$ is the heat capacity of the system and $T$ is the temperature of the system. Alternatively, it may be easier to measure the temperature change of surroundings with known heat capacity, since $q_{sys}=-q_{surr}$
Work is a little more challenging to determine, since work is defined as the change in volume at constant pressure. $w=-PdV$ (the minus sign is there to show that when the volume of the system increases, the system does work on the surroundings). However, unless you have a closed system, volume changes are difficult to measure. Additionally, pressure may not be constant.
Thus,
$$dU=q+w=cdT-PdV$$
Internal energy changes can be determined easily at constant volume $dV=0$ so $w=0$ so $dU=cdT$. Internal energy changes can also be determined in closed systems at constant pressure (so $PdV$ is evaluatable).
However, in open systems (like a beaker), $dV$ is hard to determine, making $w$ hard to determine. A new thermodynamic state function was devised to remedy this problem.
Enthalpy is a measure of the total energy of a system. More precisely, it is a thermodynamic potential. Enthalpy is defined as $H=U+PV$. $PV$ is a state function, even though $P$, $V$, $PdV$, and $VdP$ are not state functions. Thus the change in enthalpy is:
$$dH=dU+d(PV)=cdT-PdV+PdV+VdP=cdT+VdP$$
Enthalpy changes are easy to determine at constant pressure (most open systems are constant pressure systems, which is why enthalpy is so useful to most chemists), since $dP=0$ and $dH=cdT$. Enthalpy changes can also be determined in closed systems of constant volume where the pressure change can be determined.
To summarize, internal energy and enthalpy are used to estimate the thermodynamic potential of the system. There are other such estimates, like the Gibbs free energy $G$. Which one you choose is determined by the conditions and how easy it is to determine pressure and volume changes.
- At constant volume: $dU=cdT$ and $dH=cdT+VdP$
- At constant pressure: $dU = cdT-PdV$ and $dH=cdT$
- At constant volume and pressure: $dU=dH=cdT$
- At variable volume and pressure, $dU$ and $dH$ are both hard to
determine (but $dH$ may be easier since you may be able to numerically estimate $d(PV)$ from pressure-volume data).