Since you are talking about $x$-, $y$-, and $z$-axes, I'll assume we're working with 3-dimensional Euclidean space, a.k.a. $\mathbb{R}^3$. The elements of this space can be thought of as vectors, which are just ordered triples of real numbers, e.g. $(1,\sqrt{2},-5)$.
The length of a vector $(a,b,c)$ is defined to be $\sqrt{a^2+b^2+c^2}$. A vector is a unit vector when it has length equal to 1.
The $z$-axis consists of those vectors that are of the form $(0,0,t)$ for some $t\in\mathbb{R}$. It is usually given the orientation where the points $(0,0,t)$ with $t>0$ are "up".
Depending on what you mean by "points in the direction of", there are either one or two unit vectors in the direction of the $z$-axis.
If you mean that you want a unit vector that has the same orientation as the $z$-axis, then you are after a vector $(0,0,t)$ where $\sqrt{0^2+0^2+t^2}=\sqrt{t^2}=1$ and $t>0$. There is only one solution, namely $t=1$, so the only unit vector that points in the direction of the $z$-axis is $(0,0,1)$.
If you instead mean that you want a unit vector that lies within the $z$-axis, then you are after a vector $(0,0,t)$ where $\sqrt{0^2+0^2+t^2}=\sqrt{t^2}=1$. There are two solutions, namely $t=1$ and $t=-1$, so the two unit vectors that point in the direction of the $z$-axis are $(0,0,1)$ and $(0,0,-1)$.