The formula for the sum of the interior angles of a polygon is (n-2) *180, where n is the number of sides. Then you would divide the sum by the number of sides to find what one angle is.
Knowing the angle you can calculate n ( number of sides):
(n-2) * 180 / n = 135
Use distributive property:
180n - 360 / n = 135
Multiply both sides by n:
180n - 360 = 135n
add 360 to both sides:
180n = 135n + 360
Subtract 135n from both sides:
45n = 360
Divide both sides by 45:
n = 360 / 45
n = 8
The polygon has 8 sides.