Preliminaries
Consider $U = U(V,T, p)$. However, assuming that it is possible to write an equation of state of the form $p = f(V,T)$, I don't have to explicitly address the $p$ dependence of $U$, and I can write the following differential:
$$\mathrm{d}U = \underbrace{\left ( \frac{\partial U}{\partial V} \right)_T}_{\pi_T} \mathrm{d}V + \underbrace{\left ( \frac{\partial U}{\partial T} \right)_V}_{C_v} \mathrm{d}T \tag{1}$$
so one writes,
$$ \mathrm{d}U = \pi_T \mathrm{d}V + C_v\mathrm{d}T \tag{2}$$
also, for an ideal gas, the internal pressure ($\pi_T$) $= 0$
Additionally for changes in internal energy at constant pressure,
$$ \left (\frac{\partial U}{\partial T}\right)_p = \pi_T \left (\frac{\partial V}{\partial T}\right)_p +C_v \tag{3}$$
Here, I take the opportunity to define two new quantities, namely $\alpha$ and $\kappa_T$ (the expansion coefficient and the isothermal compressibility respectively)
$$\alpha = \frac{1}{V}\left (\frac{\partial V}{\partial T}\right)_p$$
and, $$\kappa_T = \frac{-1}{V}\left (\frac{\partial V}{\partial p}\right)_T$$
Rewriting (3) using $\alpha$
$$ \left (\frac{\partial U}{\partial T}\right)_p = \alpha \pi_T V +C_v \tag{4} $$
Now, although the constant volume heat-capacity is defined as $C_v = \left (\frac{\partial U}{\partial T} \right)_v$, if we let $\pi_T = 0$ in equation (4), we get $C_v = \left (\frac{\partial U}{\partial T} \right)_p$
This holds true for a perfect gas, and one can quickly obtain the desired relation at this stage.
Derivation: Difference between constant volume and constant pressure heat capacities for a perfect gas
Consider, $$C_p - C_v = \overbrace{\left (\frac{\partial H}{\partial T} \right)_p}^{\text{definition of} \ C_p} - \overbrace{\left (\frac{\partial U}{\partial T} \right)_v}^{\text{definition of} \ C_v} \tag{5}$$
Introducing, $H = U+ pV = U+nRT$, and exploiting $C_v = \left (\frac{\partial U}{\partial T} \right)_v = \left (\frac{\partial U}{\partial T} \right)_p$, equation (5) yields:
$$ C_p - C_v = \left (\frac{\partial (U+nRT)}{\partial T} \right )_p - \left (\frac{\partial U}{\partial T} \right )_p = nR$$
Derivation: Difference between constant volume and constant pressure heat capacities (general case)
However, as my contribution to this discussion I would like to derive a relation between heat capacities that is universally true for any substance, not just a perfect gas. So let's return to equation (5):
$$C_p - C_v = \overbrace{\left (\frac{\partial H}{\partial T} \right)_p}^{\text{definition of} \ C_p} - \overbrace{\left (\frac{\partial U}{\partial T} \right)_v}^{\text{definition of} \ C_v} \tag{5}$$
Here, we substitute $H = U + pV $ and obtain,
$$ C_p -C_v = \overbrace{\left( \frac{\partial U}{\partial T} \right)_p}^{\text{evaluated in} \ (4)}+ \left( \frac{\partial (pV)}{\partial T} \right)_p - C_v \tag{6}$$
The first partial derivative was already taken care of in equation (4). For the second one, since the derivative is to be evaluated at constant pressure, we can do the following
$$\left( \frac{\partial (pV)}{\partial T} \right)_p = p \overbrace{\left( \frac{\partial V}{\partial T} \right)_p}^{\alpha V}$$
Putting all of this together, one obtains
$$C_p -C_v = \alpha \pi_T V + \alpha pV = \alpha(p+ \pi_T)V \tag{7}$$
At this stage, I will make use of the following relation (derived in additional comments) $$\pi_T = T \left (\frac{\partial p}{\partial T}\right )_v - p$$ After substituting this into (7) we get:
$$ C_p -C_v = \alpha T V \left( \frac{\partial p}{\partial T} \right)_V \tag{8}$$
I wish to transform the last remaining partial derivative, and to do so I consider $ V = V(T,p) $ which yields the following differential
$$ \mathrm{d}V = \left( \frac{\partial V}{\partial T} \right)_p \mathrm{d}T + \left( \frac{\partial V}{\partial p} \right)_T \mathrm{d}p $$
At constant volume, $\mathrm{d}V = 0$ so one gets,
$$\left( \frac{\partial V}{\partial T} \right)_p \mathrm{d}T = - \left( \frac{\partial V}{\partial p} \right)_T \mathrm{d}p$$
$$\overbrace{ \left( \frac{\partial V}{\partial T} \right)_p}^{\alpha V} = \overbrace{-\left( \frac{\partial V}{\partial p} \right)_T}^{\kappa_T V} \left( \frac{\partial p}{\partial T} \right)_V$$
Note: One can avoid all of this work, and simply invoke the Euler Chain Rule
Rearranging, $$\left( \frac{\partial p}{\partial T} \right)_V = \frac{\alpha}{\kappa_T}$$
We can finally substitute this into (8) to get
$$C_p -C_v = \frac{\alpha^2 TV}{\kappa_T} \tag{9}$$
This is true for any substance, not just a perfect gas. Now, for a perfect gas $ pV = nRT$ holds true, and thus $\alpha = \frac{1}{T}$ and $\kappa_T = \frac{1}{p}$. Making these substitutions into (9), we get our desired result
$$C_p -C_v = nR $$
Additional Comments
This might seem like an unnecessarily complex, and not to mention convoluted way to get to the desired result (especially, in light of a much simpler method presented by @orthocresol), however, I think the deriving the expression for a general case first, and then reducing it to the special case is illuminating. Moreover, in spirit and approach, it is not that far from what @orthocresol did.
Physical Significance of certain terms/quantities
- $\pi_T$ is called the internal pressure (it has the dimensions of pressure) and is a consequence of the interactions between molecules. For an ideal gas it is necessarily zero.
$\alpha$ i.e the expansion coefficient is the fractional change in volume that accompanies a rise in temperature. A large volume of $\alpha$ implies that the sample responds very strongly to changes in temperature.
Similarly, $\kappa_T$ is a measures of the response to a change in pressure. The negative sign insures that $\kappa_T$ is a positive quantity, because a pressure increase causes a decrease in volume ($\mathrm{d}V$ is negative)
- Since equation (9) holds true for any substance, for solids and liquids one might be tempted to say $C_p \approxeq C_V$ because $\alpha$ is small for solids and liquids. However, one must be careful because $\kappa_T$ can be small as well, which makes the fraction $\frac{\alpha^2}{\kappa_T}$ large. In other words, even though a little work has to be done to push back the atmosphere when a solid expands, a great deal of work will go into pulling the atoms apart.
Supplementary Derivation: For a system where, $N$ doesn't change the fundamental equation of thermodynamics is:
$$\mathrm{d}U = T\mathrm{d}S -p\mathrm{d}V$$
This seems to suggest that, $U = U(S,V) $. Thus, one can write the following differential and after comparing to the one above can equate $T$ and $-p$ (as indicated by annotations) with the partial derivatives given below:
$$\mathrm{d}U = \underbrace{\left ( \frac{\partial U}{\partial S}\right)_V}_{T} \mathrm{d}S + \underbrace{\left ( \frac{\partial U}{\partial V}\right)_S}_{-p}\mathrm{d}V$$
Moreover, dividing both sides of the fundamental equation by $\mathrm{d}V$ (yeah, I know), and imposing constraint of constant temperature) we can manipulate it into the following form:
$$\overbrace{\left( \frac{\partial U}{\partial V} \right)_T}^{\pi_T} = \overbrace{\left ( \frac{\partial U}{\partial S}\right)_V}^{T}\left ( \frac{\partial S}{\partial V}\right)_T - \overbrace{\left ( \frac{\partial U}{\partial V}\right)_S}^{-p}$$
Thus, we have $$ \pi_T = T\left ( \frac{\partial S}{\partial V}\right)_T - p$$
Invoking, the Maxwell Relation
$$ \left ( \frac{\partial S}{\partial V}\right)_T = \left ( \frac{\partial p}{\partial T}\right)_V$$
one finally gets, $$\pi_T = T \left (\frac{\partial p}{\partial T}\right )_v - p$$