Re-write the right side as 2^{5}, to get:

2^{x} = 2^{5}

If the powers are equal, and the bases (here, 2) are equal the the exponents must also be equal: