Given a languaje $\mathcal{L}=(\mathcal{C},\mathcal{F},\mathcal{R})$ and $\mathcal{M}=(M,\mathcal{C}^\mathcal{M},\mathcal{F}^\mathcal{M},\mathcal{R}^\mathcal{M})$ an $\mathcal{L}$-structure. We can define a new lenguage $\mathcal{L}_\mathcal{M}$ by adjoining to $\mathcal{L}$ de elements of $M$ as constants, and we can consider the set $\text{Diag}(\mathcal{M})$ of sentences of $\mathcal{L}_\mathcal{M}$ corresponding to the atomic formulas or negation of atomic formulas of $\mathcal{M}$ that are true in this model. If I am not mistaken, this set is called the atomic diagram of $\mathcal{M}$.
I have read some times that $\text{Diag}(\mathcal{M})$ is a finite set when $M$ is finite, or some times this set is refered as a single formula $\phi(m_1,...,m_n)$. Why is this true?
As there are infinitely many terms in $\mathcal{M}$, so there are infinitely many atomic formulas. So probably this finitude refers to a subset of $\text{Diag}(\mathcal{M})$ that have the entire set as logical consequence (and if this set is finite, we can consider just one sentence using the conjunction of the finite set). If that is the case, why this finite subset exist?
You're absolutely right that according to the usual definition, if there are any function symbols in the language, then the atomic diagram of any nonempty structure $M$ is infinite.
But it's not hard to see that if $M$ is finite, then the atomic diagram of $M$ is actually equivalent to a finite set of $\mathcal{L}_M$-sentences (and hence to a single sentence by taking the conjunction). I think the cleanest way is to consider the following set of $\mathcal{L}_M$ sentences:
This set of sentences is sometimes called the "flat diagram" of $M$: "flat" since there is no nesting of terms. The flat diagram is finite when $M$ is finite, by construction. I'll leave it as an exercise for you to show that every atomic formula which is true in $M$ is a consequence of the flat diagram of $M$. The flat diagram generalizes the notion of the multiplication table of a group more directly than the atomic diagram does.