Let $H$ be a Hilbert-space and $S$ be a sub(Hilbert)space such that: $$H = S \oplus S^\perp$$
Then the projection operators are defined as:
$$P_S: H\to S; x = u + v \mapsto u \quad\quad P_{S\perp}: H \to S^\perp; x = u+v \mapsto v$$
My professor said: 'Notice these operators are idempotent, since $P_s^2 = P_s$.'
Then he asked if any idempotent operator is a projection operator, and what should be demanded if you want this to be the case.
Counterexample
It seems clear to me that a operator which is idempotent isn't always a projection operator. I was thinking of two counterexamples. I have my doubts if the first counterexample is any good. $$\mathbf{1}: H \to H; x \to x$$ However this would imply $S$ to be $H$ which results in the direct sum $H = H \oplus \{0\}$. Then the identity operator would be a projection operator.
I guess the first counterexample isn't a good one? Perhaps this one is better: Consider $H = \mathbb{C}$, then define $f: \mathbb{C}\to \mathbb{C}; z \to \overline z$. Is this a better counterexample?
Sufficient condition
I have no clue what condition I could add to make the converse statement true. Could anyone help?
The answer depends on what is meant by "a projection operator".
If $P$ is any idempotent operator then, as suggested by user254665, you can write $H=\ker(P)\oplus \ker(Id-P)$. (This follows because for any $x\in H$ you have $x-P(x)\in\ker(P)$.) Hence, $P$ appears to be the "projection operator" onto $\ker(Id-P)$ along $\ker(P)$.
On the other hand, if you require that $P$ should be an orthogonal projection, then the answer is of course negative: just consider two closed but not orthogonal subspaces $E,F$ such that $H=E\oplus F$ and take the projection $P$ onto $E$ along $F$.
One may also add that an idemptotent operator $P$ is an orthogonal projection if and only if it is self-adjoint, and that this is also equivalent to $\Vert P\Vert\leq 1$ (a nice exercise).