Does the expansion of spacetime add energy to matter? If I understand correctly when the universe expands the matter in it is expanded as well but the "rest length" of the matter that gets stretched stays the same. So let's say I have a crystal in the ground state meaning all its atoms are at the ideal distance apart. When this crystal sits in an expanding spacetime does that mean that the atoms will be displaced from their ideal resting position resulting in the crystal gaining energy? Does this mean all the matter in the universe is always gaining a tiny amount of energy from the expansion of spacetime?
 A: It is not necessarily adding energy (in fact, I must admit yours is the first example I've ever heard of energy gain), but yes, the Universe's expansion does change the energy of matter in it. A way of thinking about is the fact that the stress-energy-momentum tensor in general depends on the metric tensor.
Let me provide a different example, that also shows that energy is sometimes being stolen from matter: as a photon travels through an expanding universe, its wavelength is increased by means of the cosmological redshift. As a consequence, it is losing energy.
Notice that these are not problems of the theory: energy conservation is a consequence of Noether's theorem for systems with time-translation symmetry, but an Universe in expansion is not such a system. Its metric explicitly depends on time, and hence there is no reason to assume energy conservation would need to hold.
In your particular example, I believe what will likely happen is that the atoms will just move together again to compensate for the extra spacing. Nowadays, the value of the Hubble constant is $H_0 \approx 70 \ \text{km} \ \text{s}^{-1}\ \text{Mpc}^{-1} \approx 0.07 \ \text{Gyr}^{-1}$, meaning it takes roughly a billion years for some structure to be expanded by $0.07 = 7\%$ (values and this last bit quoted from Wikipedia's page on the Hubble Law). Hence, for small structures such as crystals, the effect is essentially negligible. Nevertheless, if the constant was sufficiently large, the expansion would be able to tear the crystals apart. In fact, for a constant of $H \sim 10^{18} \ \text{s}^{-1}$ it should be able to rip the electron from a hydrogen atom (I'm estimating the number by converting the typical size of a hydrogen atom to a time scale using the speed of light as a conversion factor).
Explicit Example: Closed, Radiation-Filled Universe
Jerry Schirmer mentioned in the comments that arguing with photons alone can be problematic, and while I think photons are good to have some intuitive idea of what is happening, I agree with his points and this picture shouldn't be taken too literally. After thinking a bit about it, I got excited and decided to open up a few calculations.
To provide a quantitative example, let us consider the case for a Friedman–Lemaître–Robertson–Walker universe filled with radiation and spatially closed. This means the metric has the form
$$\text{d}s^2 = - \text{d}\tau^2 + a(\tau)^2 [\text{d}r^2 + \sin^2{r} \ \text{d}\Omega^2]$$
and the Einstein equations simplify to
$$\left\lbrace\begin{aligned}
3 \frac{\dot{a}^2}{a^2} &= 8 \pi \rho - \frac{3}{a^3}, \\
3 \frac{\ddot{a}}{a} &= - 8 \pi \rho,
\end{aligned}\right.$$
where $\rho$ is the radiation's energy density.
Solving these equations, one gets to
$$a(\tau) = \sqrt{1 + H_0^2 - \left(\tau - \sqrt{1 + H_0^2}\right)^2},$$
where $H_0$ is the present-day value of the Hubble constant ("present-day" is also the time $\tau_0$ such that $a(\tau_0) = 1$). Furthermore, notice that $a(0) = 0$ (that's the Big Bang). This equation can be found, for example, on Wald's General Relativity, Table 5.1 (p. 98), although he chooses to write the constants in terms of the constant $C' = 1 + H_0^2$.
One can show that the radiation's energy density $\rho$ in this scenario satisfies
$\rho a^4 = \text{constant}.$
See, e.g., Wald's book, Eq. (5.2.20). Since today we have $a(\tau_0) = 1$, we see by evaluating the expression at $\tau = \tau_0$ that the constant is just $\rho_0$, today's value of the energy density. From the Einstein Equations and the fact that the Hubble parameter is defined as $H = \frac{\dot{a}}{a}$, we see that
$$\rho_0 = \frac{3 (1 + H_0^2)}{8 \pi},$$
but I'll keep using $\rho_0$ for a while to make the equations cleaner.
Let us compute the total energy present in the radiation at a given instant of cosmological time $\tau$. Since matter is assumed to be uniformly distributed and space is just a $3$-sphere of radius $a(\tau)$, we have
$$\begin{align}
E(\tau) &= a(\tau)^3 \int_{S_3} \rho(\tau) \text{d}^3 \Omega_3, \\
&= 2\pi^2 a(\tau)^3 \rho(\tau), \\
&= \frac{2\pi^2 a(\tau)^4 \rho(\tau)}{a(\tau)}, \\
&= \frac{2\pi^2 \rho_0}{a(\tau)}.
\end{align}$$
Bringing together everything, we find that
$$E(\tau) = \frac{3 \pi (1 + H_0^2)}{4 \sqrt{1 + H_0^2 - \left(\tau - \sqrt{1 + H_0^2}\right)^2}}.$$
Plotting this expression on Desmos for $H_0 = 1$ (just so we can see the shape), we get the following figure:

Hence, we see that the radiation's total energy density decreases and then starts increasing again. The minimum of the total energy density occurs when the Universe reaches its maximum size, and then starts to increase again when the Universe starts shrinking.
While Wald does not derive this result explicitly, he comments on it right after Eq. (5.2.20), and interprets that the numerical density of photon decreases with $a^3$ (the expanding radius of the Universe), but the energy per photon also decreases as $a$ due to cosmological redshift. As mentioned earlier, this picture provides an intuitive interpretation, but shouldn't be taken too literally.
Let me also mention that Sean Carroll has a blog post discussing non-conservation of energy in General Relativity. He also points out that there are some people who prefer to interpret these results as saying that energy is conserved if you account for the energy of the gravitational field and explains why not everyone takes this position.
A: The crystal is a lump of matter of fixed size, and the expansion of the universe simply means that other lumps of matter are moving away from it on average over very large scales. There is no force or other effect due to the expansion that acts on the crystal, that would cause it to gain or lose energy.
If the cosmological constant $Λ$ is nonzero then there is a constant force (outward if $Λ>0$) that makes the bond length of the crystal in the ground state slightly different than it would be in a universe with $Λ=0$, but that effect is independent of time, so it doesn't cause the crystal to gain or lose energy over time, and it isn't related to the expansion as such, since it doesn't depend on $a(t)$.
It's easy to get confused about this because beginning cosmology (the FLRW metric and the Friedmann equations) assumes that matter is homogeneous at all scales. If you naively apply FLRW cosmology to this problem, you'll find a time-varying force on the crystal that depends on $a'(t)$ or $a''(t)$, but it's actually a spurious result due to the contradictory assumptions of perfect homogeneity and the existence of a lump of matter. I wrote about this in more detail in another answer.
