The necessary and sufficient conditions are: $(1/n)\sum x_j=(1/3)(a+b+c)$, and all $x_j$ lie inside
the closed triangle $(a,b,c)$.

Proof of sufficiency. For every affine function, we have equality.
Let $f$ be convex. Then there exists a unique affine function $g$ which matches $f$
at $a$, $b$ and $c$. And we have $f\leq g$ in the triangle $(a,b,c)$. Thus
$$\sum f(x_j)/n\leq\sum g(x_j)/n=(g(a)+g(b)+g(c))/3=(f(a)+f(b)+f(c))/3.$$

Necessity. If some point is outside, it is easy to construct a piecewise affine function
which is zero on the triangle and positive outside, so the inequality is violated.
If $A=(x_1+...+x_n)/n$, does not coincide with $B=(a+b+c)/3$,
then it is easy to see that there exists an affine function which violates the inequality.

This has a straightforward generalization to any dimension.