$\begingroup$

Once upon a time I was told that the torus is flat. This was supposed to be surprising, since the ordinary picture of a torus we have in our heads looks inherently curved. However, thinking instead of a torus as a square in the plane with opposite points identified, it becomes 'clear' that the torus at least admits a flat metric, because the plane admits a flat metric.

However, a two-holed torus can also be obtained in this way: it is an octagon in the plane with appropriate pairs of edges identified. However, by the Gauss-Bonnet theorem, this surface does not admit a flat metric.

Thus, something about the way we make the identifications for the 1-torus is compatible with the flat metric structure on the plane, and this is not so for the 2-torus. I am hence lead to ask:

Given a smooth manifold $M$ obtained from $\mathbb{R}^n$ by appropriate identifications, is there some general criterion for determining whether the flat metric on $\mathbb{R}^n$ descends to $M$? Or is the $n$-dimensional torus particularly special in its ability to inherit a metric from the plane? If so, what is special about it?