Taking the square root $n$ times is taking the $2^n$-th root. If the $2^n$-th root of $x$ is $\le\sqrt2$, but the $2^{n-1}$-st root of $x$ is $>\sqrt2$, then
$$x^{1/2^n}\le \sqrt2<x^{1/2^{n-1}}\;,$$
which, after raising everything to the $2^n$ power, is equivalent to
$$x\le (2^{1/2})^{2^n}<x^2\;,$$
or $$x\le 2^{2^{n-1}}<x^2\;.$$ Now take logs base $2$ (which I write $\lg$):
$$\lg x\le 2^{n-1}<2\lg x\;,$$ which after a little massage can be written $$2^{n-2}<\lg x\le 2^{n-1}\;.$$
Take your examples: $\lg 16=4$, so $2^1<\lg 16\le 2^2$, and we must have $n=3$, while $\lg 27$ is clearly between $4$ and $5$, so $2^2<\lg 27\le 2^3$, and we must have $n=4$.
Taking the floor of the square root each time complicates matters slightly, but not much. $\lfloor\sqrt x\rfloor\le\sqrt2$ iff $x<2^2$ iff $\lg x<2$, $\lfloor\sqrt x\rfloor<2^2$ iff $\sqrt x<2^2$ iff $x<2^{2^2}$ iff $\lg x<2^2$, $\lfloor \sqrt x\rfloor\le 2^{2^2}$ iff $\sqrt x<2^{2^2}$ iff $x<2^{2^3}$ iff $\lg x<2^3$, and so on. If $\frac12<\lg x<2$, one step is required. If $2\le\lg x<2^2$, two steps are required. In general, $n$ steps are required if $2^{n-1}\le\lg x<2^n$.