Mark Trodden in Cosmic Variance:
When we apply GR to cosmology, we make use of the simplifying assumptions, backed up by observations, that there exists a definition of time such that at a fixed value of time, the universe is spatially homogeneous (looks the same wherever the observer is) and isotropic (looks the same in all directions around a point). We then specialize to the most general metric compatible with these assumptions, and write down the resulting Einstein equations with appropriate sources (regular matter, dark matter, radiation, a cosmological constant, etc.). The solutions to these equations are the famous Friedmann, Robertson-Walker spacetimes, describing the expansion (or contraction) of the universe.
It is important to take a moment to emphasize what we have done here. GR is indeed a beautiful geometric theory describing curved spacetime. But practically, we are solving differential equations, subject to (in this case) the condition that the universe look the way it does today. Differential equations describe the local behavior of a system and so, in GR, they describe the local geometry in the neighborhood of a spacetime point.
Because homogeneity and isotropy are quite restrictive assumptions, there are only three possible answers for the local geometry of space at any fixed point in time – it can be spatially positively curved (locally like a 3-dimensional sphere), flat (locally like a 3-dimensional version of a flat plane) or negatively spatially curved (locally like a 3-dimensional hyperboloid). A given cosmological solution to GR tells you one of these answers around a spacetime point, and homogeneity then tells you that this is the same answer around every spacetime point. This is what we mean when we say that GR tells us about geometry – the shape of the universe – as depicted in the NASA graphic below.
This raises a very different question that is often confused with the one above. If our solution tells us that the universe is locally a 3-sphere (or flat space, or a hyperboloid) around every point, then does that mean it is a 3-sphere, or an infinite flat 3-dimensional space, or an infinite hyperboloid. This is really a question of topology – how is it connected up – which also answers the question of whether the universe is finite or infinite.