In the picture above we see an internal wave propagating in the direction of the wavenumber vector $$\mathbf{K} = k \mathbf{e_x} + m \mathbf{e_z}$$ which (in 2D) is given by the vector sum of its components. $\mathbf{e_x}$ and $\mathbf{e_z}$ are unit vectors in the horizontal and vertical directions, respectively.
The continuity condition implies that $\mathbf{K} \cdot \mathbf{u}=0$. Hence, the direction of energy propagation (group velocity) is perpendicular to the direction of propagation of wave crests and troughs (phase velocity). Internal gravity waves are transverse waves so the fluid motion is parallel to lines of constant phase as indicated by the Eulerian velocity vector, $\mathbf{u}$.
The vertical wave number $m$ is the vertical component of the wavenumber vector because in a continuously stratified fluid internal waves can propagate in all directions. In fact, in the real ocean there is a third component, denoted by $l$ which is in the transverse direction so that the full wavenumber vector is
$$\mathbf{K} = k \mathbf{e_x} + l \mathbf{e_y} + m \mathbf{e_z}$$