The number of sides of a regular polygon is 360 divided by the size of the exterior angle. The external angle is 180 - the internal angle.
So for a regular polygon with an internal angle of 135 we get the following.
360 / (180 - 135) = 360 / 45 = 8 sides