Versions of this question have been asked on this site before but have not directly addressed by concern. In the $(+---)$ convention the EM lagrangian in the presence of charge sources is
$$ \mathcal{L} = -\frac{\sqrt{-g}}{4} F^{\mu \nu} F_{\mu \nu} + \sqrt{-g} j^\mu A_\mu. $$
Using the equation $$ T_{\mu \nu} = \frac{2}{\sqrt{-g}} \frac{\partial \mathcal{L} }{\partial g^{\mu \nu} } $$
we get $$ T_{\mu \nu} = - F_{\mu}^{\: \, \alpha} F_{\nu \alpha} + g_{\mu \nu} \frac{1}{4} F^{\alpha \beta} F_{\alpha \beta} + g_{\mu \nu} j^\alpha A_\alpha $$
The first two terms correspond to the stress-energy tensor of a free $(j = 0)$ EM field. The third term, however, is not gauge invariant. Isn't this a problem? The right hand side of $G_{\mu \nu} = 8 \pi G T_{\mu \nu}$ should not depend on gauge. Isn't there an ambiguity when you have charged matter in a gravitational field?