8

How many sides can a convex polygon have if all its diagonals are of the same length?
Let's prove that the number of sides of such a polygon does not exceed 5. Suppose that all diagonals of the polygon $A_{1} \ldots A_{n}$ have the same length and $n \geq 6$. Then the segments $A_{1} A_{4}, A_{1} A_{5}, A_{2} A_{4}$, and $A_{2} A_{5}$ have the same length, as they are diagonals of this polygon. However, in the convex quadrilateral $A_{1} A_{2} A_{4} A_{5}$, the segments $A_{1} A_{5}$ and $A_{2} A_{4}$ are opposite sides, while $A_{1} A_{4}$ and $A_{2} A_{5}$ are diagonals.

Therefore, $A_{1} A_{5} + A_{2} A_{4} < A_{1} A_{4} + A_{2} A_{5}$. This leads to a contradiction.

It is also clear that a regular pentagon and a square satisfy the required condition.