Electrons move like waves, but exchange energy and momentum like particles. When they act like particles their energy is $E=\hbar\omega$ and their momentum is $\vec{p}=\hbar\vec{k}$.
The wave-like nature of an electron is described by a wave function $\psi$. The wave function is a solution to the Schrödinger equation and the probability of finding the electron at a position is $\psi^*\psi$.
The valence electrons of metals become unbound from their atomic nuclei due to electron screening. These electrons act like noninteracting fermions moving in a constant potential $V=0$. This is the free electron approximation.
The wave function for free electrons is,
$$\psi(\vec{r}) = \frac{1}{\sqrt{L^3}}e^{i\vec{k}\cdot\vec{r}},$$
and the energy of free electrons is,
$$E = \frac{\hbar^2 k^2}{2m}.$$
$L$ is the size of the crystal and $\vec{k}$ is restricted to those values that satisfy the periodic boundary conditions.
The electrons fill the energy levels according to the Pauli exclusion principle, starting with the lowest energy level at $\vec{k}=0$. Two electrons can occupy every $\vec{k}$ state due to spin.
In a typical metal, there are some many energy levels that an electron density of states $D(E)$ is defined which states how many energy levels there are at each energy per m³. This density of states is 0 for $E < 0$ and is proportional to $1/\sqrt{E}$ in one dimension, is constant in two dimensions, and is proportional to $\sqrt{E}$ in three dimensions.
The probability that an electron state is occupied is given by the Fermi function,
$$f(E) = \frac{1}{\exp{\left(\frac{E-\mu}{k_BT}\right)}+1}$$
where $\mu$ is the chemical potential and is determined by the condition,
$$n=\int\limits_{-\infty}^{\infty}\frac{D(E)}{\exp{\left(\frac{E-\mu}{k_BT}\right)}+1}dE.$$
where $n$ is the valence electron density.
At room temperature, the chemical potential is almost the same as the chemical potential at $T=0$ and it is typically weakly temperature dependent.
The internal energy density $u$ is the energy $E$ times the number of electron states at that energy $D(E)$ times the probability that a state at that energy is occupied $f(E)$, summed over all energies,
$$u =\int\limits_{-\infty}^{\infty}ED(E)f(E)dE \approx \frac{3}{5}nE_F + \frac{\pi^2}{4}\frac{n}{E_F}(k_BT)^2\quad\text{ J m}^{-3}.$$
Here, the last approximate expression was derived using the Sommerfeld expansion.
Once the internal energy is known, other thermodynamic properties such as the chemical potential, internal energy, Helmholtz free energy, specific heat, entropy, pressure, and bulk modulus can be calculated.
Measured thermodynamic properties such as the specific heat and the bulk modulus are fit to the free electron expressions using the electron density $n$ and the electron effective mass $m$ as parameters.
To separate the electron contribution from the phonon contribution to the specific heat, the low temperature measurement is fit to $c_v = \gamma T + AT^3$ where $\gamma T $ is the electron contribution and $AT^3$ is the phonon contribution.
References
Kittel chapter 6: Free electron Fermi gas or R. Gross und A. Marx: Das freie Elektronengas
R. Gross und A. Marx: Sommerfeld Entwicklung