I think it's an integer when (1) $n$ is odd (that's obvious) and (2) $m$ divides $n-1$, where $m$ is the smallest integer $m>0$ such that $2^m \equiv 1 \pmod n$. Not fully sure though, need to refresh a bit my knowledge on this topic :) That $m$ had some special name. Such an $m$ exists for sure because $\phi(n)$ is one such $m$ (when n is odd of course) but it's not necessarily the smallest ...
... OK, this $m$ is called the multiplicative order of $2$ modulo $n$. So $k$ is an integer if and only if (1) $n$ is odd and (2) the multiplicative order of $2$ modulo $n$ divides the number $n-1$. In fact this statement would be true, if you take another power and not just $n-1$ in particular.
Multiplicative Order Modulo n