Definition: the angle formed by any side of a
polygon
and the extension of its adjacent side

Try this
Adjust the polygon below by dragging any orange dot. Click on "make regular" and repeat.
Note the behavior of the exterior angles and their sum.

Regular polygons

In the figure above check "regular". As you can see, for regular polygons all the exterior angles are the same,
and like all polygons they add to 360° (see note below). So each exterior angle is 360 divided by the n, the number of sides.
As a demonstration of this, drag any vertex towards the center of the polygon. You will see that the angles combine to a full 360° circle.

Convex case

In the case of convex polygons,
where all the vertices point "outwards" away form the interior, the exterior angles are always on
the outside of the polygon. In the figure above, check "regular" and notice that this is the case.

Although there are two possible exterior angles at each vertex (see note below)
we usually only consider one per
vertex, selecting the ones that all go around in the same direction,
clockwise in the figure above.

Taken one per vertex in this manner, the exterior angles always add to 360°

This is true no matter how many sides the polygon has, and regardless of whether it is
regular
or
irregular,
convex or
concave.
In the figure above, adjust the number of sides, switch to irregular and drag a vertex to see that this is true.

In the figure above click on 'reset' and check "both". You will see that both angles at each vertex are always congruent (same measure).
This is because they form a pair of vertical angles, which are always congruent. Drag the vertices around and convince yourself this is true.

Concave case

If the polygon is
concave, things are a little trickier. A concave polygon has one or more vertices "pushed in" so they point towards the interior.
In the figure above, uncheck "regular" and drag a vertex in towards the interior of the polygon.
Notice that the exterior angle flips over into the inside of the polygon and becomes negative.
If you add the exterior angles like before, they still add to 360°, you just have to remember to add the negative angles correctly.

In the figure above, imagine the polygon drawn on the ground. Stand on one of the sides and face along the line.
Now if you walk around the polygon along each line in turn, you will eventually wind up back where you started, facing the same way.
So you must have turned through a total of 360°, a full circle. This confirms that the exterior angles, taken one per vertex, add to 360°

The sum of exterior angles - watch out!

In most geometry textbooks they say flatly that the exterior angles of a polygon add to 360° This is only true if:

You take only one per vertex, and

Take all the angles that point in the same direction around the polygon.

But in many cases they fail to state these conditions.
In the figure at the top of the page, check the "Both" checkbox.
You will see there are two per vertex and they actually add to 720° (360 times 2)

So if you are asked "What is the sum of the exterior angles of a polygon?" without any conditions,
you will have to guess which one they mean.
Usually they mean taking one per vertex, and the answer is 360°, although strictly speaking this is wrong.