The greatest number of sides the polygon could have is 360.

As each interior angle of the polygon is a whole number of degrees, the same must apply to each exterior angle. The sum of the exterior angles of a polygon is 360° and so the greatest number of sides will be that of 360-sided polygon in which each interior angle is 179°, thus making each exterior angle 1°.