The units are both $\text{N}\cdot \text{m}^{-1}$ or $\text{kg}\cdot \text{s}^{-2}$.
The units of the mass $m$ is $\text{kg}$ and the units of the period $T$ is $\text{s}$.
Substituting the units into your formula, you get:
$$\frac{\text{kg}}{\text{s}^{2}}=\text{kg}\cdot \text{s}^{-2}$$
We can ignore the $4\pi^2$, since it is a dimensionless (unitless) constant.
Note that $\text{N}\cdot \text{m}^{-1}$ is equivalent to $\text{kg}\cdot \text{s}^{-2}$ because the units for force can be written as $\text{kg} \cdot \text{m} \cdot {\text{s}^{-2}}$ and so, substituting this into $\text{N} \cdot \text{m}^{-1}$ gives $\text{kg} \cdot \text{m} \cdot {\text{s}^{-2}} \cdot \text{m}^{-1}=\text{kg} \cdot {\text{s}^{-2}}$, which was the result obtained.