First of all, note that $\left| \frac{-1 \pm i\sqrt 3}{2} \right| = 1$, hence this holds for all $n$th powers of these quantities also.
The triangle inequality states that $|a| + |b| \geq |a+b|$, with equality holding if and only if $a$ is a scalar multiple of $b$.
In our case, if we assume that the final condition holds, we have that for $a,b = \left(\frac{-1 \pm i\sqrt 3}{2}\right)^n$ (it doesn't matter which is which), $2 = |a| + |b| \geq |a+b| = 2$, which means equality is being obtained in the triangle inequality.
This means that $\left(\frac{-1 + i\sqrt 3}{2}\right)^n$ is a scalar multiple of $\left(\frac{-1 - i\sqrt 3}{2}\right)^n$. However, since both have modulus $1$, we can check that this happens if and only if $\left(\frac{-1 + i\sqrt 3}{2}\right)^n = \left(\frac{-1 - i\sqrt 3}{2}\right)^n$.
Hence, dividing both sides by $\left(\frac{-1 - i\sqrt 3}{2}\right)^n$ (it can't be zero, as it has modulus $1$), we get that (I leave you to see this) $\left(\frac{-1 + i\sqrt{3}}{2}\right)^n = 1$.
If you know your roots of unity well, this gives $n = 3k$, where $k$ is an integer.