Let V1,V2,V3⋯Vn be the vertices of the polygon.
WLOG V1V2=V2V3=1 then by triangle inequality on V1V2V3, V1V3<V1V2+V2V3
If n≥4 then V1V3=1 then V1V2V3 is an equilateral triangle.
Suppose that n≥6 then V1V4 and V2V4 are diagonals then
triangle inequality on triangle V1V2V4 implies V1V4=V2V4
Similarly V1V5=V2V5 however V3, V4 and V5 are on the perpendicular bisector of V1V2 Contradiction, therefore n≤5
and similarly with V2V5=V3V5 to get the example for n=5 and concave polygon
if you add the convex condition n=4 is the maximum.