Certainly the condition that $M$ is nilpotent is sufficient. Let $k$ be the smallest positive integer with $M^k=0$. Then we may take $N=M^{k-1}\neq 0$ to obtain
$$
MN+NM=M^k+M^k=0.
$$
On the other hand, the example $M=I$ shows that there may be no nonzero anticommuting matrix $N$. Suppose first that $M$ is invertible. Then $MN+NM=0$ implies
$$
N=M^{-1}(-N)M
$$
so that $N$ and $M$ are similar. In particular, $N$ must have trace zero.
If both $M$ and $N$ are invertible, taking determinants we obtain $\det(N)\det(M)=(-1)^n\det(N)\det(M)$, hence $1=(-1)^n$, which gives the necessary condition that $n$ is even, and that $tr(N)=tr(M)=0$.
In general there is a lot of literature on anticommutaing matrices, which might help in giving necessary and sufficient conditions for the existence of a non-trivial anticommuting matrix to a given one. As a start, see the question here.