When $k=0$, $x^3-12x=0\Leftrightarrow x=0\text{ or }x=\pm2\sqrt3$, so there are three real solutions in that case. Graphically, that means the curve $y=x^3-12x+k$ is "curvy enough" to have three distinct real zeros. The symmetry of the solutions in the $k=0$ case suggests that there are two values of $k$ at which we will go from having 3 real solutions, to 2 real solutions, to 1 real solution, and they are opposites. The boundary case, when we have 2 real solutions with one having multiplicity 2, should factor in the form $(x-a)(x-b)^2=x^3-(a+2b)x^2+(2ab+b^2)x-ab^2$, so we need $a+2b=0$ and $2ab+b^2=-12$. Solving that system gives $(a,b)=(4,-2)$ or $(a,b)=(-4,2)$, which give $k=-ab^2=\pm16$.

So, when $-16<k<16$, there are three distinct real solutions; when $k=\pm16$, there are two distinct real solutions; and when $k<-16$ or $k>16$, there is one real solution (and a conjugate pair of nonreal complex solutions).

We interpret "algebraic" somewhat loosely, in order to describe some material that was once a part of school algebra, but no longer is.

Look somewhat more generally at $x^3-ax+k=0$. Recall the identity
$$\cos 3\theta=4\cos^3 \theta-3\cos\theta.$$
We want to make our cubic look like $4t^3-3t=c$.

Do this by making the change of variable $x=\lambda t$. Then our equation becomes
$$\lambda^3 t^3-a\lambda t +k=0.$$
We want to have $\dfrac{\lambda^3}{a\lambda}=\dfrac{4}{3}$. Solve for $\lambda$. We get $\lambda=\sqrt{4a/3}$.

For simplicity we now go back to our specific numbers, though the argument can be made quite general. With $a=12$, we can take $\lambda=4$.

Substitute in our equation. After a bit of manipulation, it becomes
$$4t^3-3t=-\frac{k}{16}.\qquad\qquad(\ast)$$
By comparison with the identity for $\cos 3\theta$, $(\ast)$ has three (not necessarily distinct) solutions iff $-k/16$ is the cosine of something (which we call $3\theta$). So the necessary and sufficient condition for $3$ not necessarily distinct real roots is $|-k/16|\le 1$. Let $3\theta=\arccos(-k/16)$. Then the solutions of $(\ast)$ are $\cos(\theta)$, $\cos(\theta+2\pi/3)$, and $\cos(\theta+4\pi/3)$. For some special values of $\theta$, two or more roots coincide.

More general cubics can be handled in the same way. If for example we are interested in $x^3+px^2+qx+r=0$, first make the substitution $x=y-p/3$. The resulting polynomial has no $y^2$ term.

The substitution trick $x=y-p/3$ goes back to Cardano. The trigonometric solution of the cubic in the case of all real roots is due to Vieta.