The covariance of random variables $X$ and $Y$ measures how their deviations from their respective means vary together:

$$ \text{Cov}(X,Y)=\Bbb E[(X-\Bbb E[X])(Y-\Bbb E[Y])] $$

Equivalently:

$$ \text{Cov}(X,Y)=\Bbb E[XY]-\Bbb E[X]\Bbb E[Y] $$

where

Variance is a special case of covariance:

$$ \text{Var}(X)=\text{Cov}(X,X) $$

References

Variance