We can use Pythagoras theorem for it.
Pythagoras theorem is
The square of the hypotenuse (longest side) equals to the square of the other sides added together.
b^2 + x^2 = a^2
So we just substitute the numbers given into the equation.
12^2 + x^2 = 13^2
144 + x^2 = 169
X^2 = 25
X = 5
Therfore the answer is 5 cm