Yes. In geometry, a polygon is by definition a closed plane figure made of straight line segments (its sides) joined end to end. Britannica defines a polygon as “any closed curve consisting of a set of line segments (sides) connected such that no two segments cross,” so triangles, rectangles, pentagons and hexagons all qualify.
A shape with an open gap, or one with any curved side such as a circle, is not a polygon. Some mathematicians also count self-crossing figures such as star polygons, but under every common definition a polygon must still be closed.
Source: Polygon — Encyclopaedia Britannica; see also Wolfram MathWorld: Polygon.