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?

Let $M$ be a manifold and $G$ a discrete group acting freely and proper discontinuously, then $M/G$ is a manifold. If $g$ is a Riemannian metric on $M$, then it descends to a Riemannian metric on $M/G$ if and only if the group $G$ acts by isometries; to be precise, by 'descends to a Riemannian metric on $M/G$', I mean there is a Riemannian metric $g'$ on $M/G$ such that $g = \pi^*g'$ where $\pi : M \to M/G$ is the quotient map. To see how to construct $g'$ from $g$, see this answer where I show that the standard metric on $\mathbb{R}^n$ descends to the torus $\mathbb{R}^n/\mathbb{Z}^n$; here the group $G = \mathbb{Z}^n$ is acting by translations which are isometries of the usual metric on $\mathbb{R}^n$.
If $(M, g)$ is flat, and $g$ is complete, then its universal cover is isometric to $\mathbb{R}^n$ with its standard metric, so every complete flat manifold is a quotient of $\mathbb{R}^n$ with its standard metric by a discrete group of isometries which acts freely; note, every discrete group of isometries of $\mathbb{R}^n$ acts properly discontinuously. If in addition $M$ is compact, then the group action is cocompact; a discrete group of isometries which acts cocompactly is called a crystallographic group, if it also acts freely, it is called a Bieberbach group; note, a Bieberbach group can equivalently be defined as a torsion-free crystallographic group (this is the usual definition). Bieberbach showed that an $n$-dimensional crystallographic group has a finite index subgroup isomorphic to $\mathbb{Z}^n$, from which it follows that every compact flat manifold is finitely covered by a torus.
Note that not every subgroup of isometries of $\mathbb{R}^n$ gives rise to a flat manifold as it may not act freely on $\mathbb{R}^n$. For example, every isometry of $\mathbb{R}^2$ is a composition of reflections, rotations, and translations; the first two transformations have fixed points, so they don't act freely on $\mathbb{R}^2$. If the subgroup does not act freely, the quotient will be a flat orbifold instead of a flat manifold. Moreover, every flat orbifold arises this way, see Theorem $13.3.10$ of Foundations of Hyperbolic Manifolds (second edition) by Ratcliffe. In particular, a quotient of $\mathbb{R}^n$ by a crystallographic group which is not a Bieberbach group gives a compact flat orbifold which is not an manifold.