Assume we have a smooth manifold, $M$, of dimension $n$. (An example of interest is the case when $M$ is a compact and orientable Riemann surface of genus $g$, but the question is intended to be broad.)
Then cover $M$ by open sets $\cup_iU_i=M$. In a local coordinate chart, $(U_i,\phi_i)$, where $\phi_i:U_i\rightarrow \mathbb{R}^n$, let us denote these local coordinates by $(\sigma^1,\dots,\sigma^n)$.
My question is: under what conditions do coordinates such as $(\sigma^1,\dots,\sigma^n)$ exist that cover the entire manifold, $M$, and more importantly why?
Related questions are: what is the obstruction to extending the local chart to cover the entire surface (except possibly for a discrete set of points in $M$)? Is there a general reasoning that applies to all cases (at least for the case of an orientable compact Riemann surface)?
Any help much appreciated!