(Disclaimer. The following describes some cohomological conditions that formally answer the question. But they are 1) usually too hard to compute; 2) don't really explain what is the class of parallelizable manifolds geometrically.)
The problem of existence of a section is answered (well, in a sense) by obstruction theory. Namely, there is the first obstruction $o_1\in H^1(X,\pi_0(F))$ and there is a section on $sk_1(X)$ iff $o_1=0$; if $o_1=0$ each section on $sk_1(X)$ defines an obstruction $o_2\in H^2(X,\pi_1(F))$ and so on (and if all obstructions are trivial, the bundle has a section).
(Well, actually one should be careful with $H^1(X;\pi_0(F))$: in general, $\pi_0(F)$ is not a group, so this $H^1$ just doesn't make sense, and the story starts a step (or two, if $\pi_1(F)$ is not abelian) later. But in the cases we're interested in, $o_1$ is well-defined.)
In the case of frame bundle of $n$-dimensional vector bundle, the fiber is $O(n)$, so obstructions lie in groups $H^i(M,\pi_{i-1}O(n))$. In the stable range homotopy groups of orthogonal groups are given by Bott periodicity. If we're talking about tangent bundle, we care only about $\pi_{i-1}(O(n))$ for $i\leq n$ and for $i<n$ these groups lie in the stable range.
A (toy) example: for $S^3$ only nontrivial (reduced) cohomology group is $H^3(S^3)$; but $\pi_2 O(n)=0$ — so any vector bundle on $S^3$ is trivial (well, not the simplest proof of the fact, but still).
In case of vector bundles these obstructions can be also described more geometrically (in the spirit of characteristic classes theory).
- First obstruction $o_1\in H^1(M;\pi_0 O(n))=H^1(M;\mathbb Z/2\mathbb Z)$ is nothing else but $w_1$, the first Stiefel-Whitney class. It gives the obstruction to orientability — i.e. to reducing the structure group of the bundle from $O(n)$ to $SO(n)$.
- If the bundle is oriented, second obstruction $o_2\in H^2(M;\pi_1 O(n))=H^1(M;\mathbb Z/2\mathbb Z)$ is defined. It coincides with $w_2$ and gives the obstruction to the existence of a spin struction — i.e. to lifting structure group of the bundle from $SO(n)$ to its universal cover, $Spin(n)$.
- Next obstruction is defined for a spin bundle; $\pi_2O(n)=0$, so first non-trivial obstruction here is $o_4\in H^4(M;\pi_3 O(n))=H^4(M;\mathbb Z)$. In fact, it coincides with $\frac12p_1$ (where $p_1$ is the first Pontryagin class of oriented bundle). And it is the obstruction to lifting the structure group from $Spin(n)$ to (infinite-dimensional) topological group $String(n)$.
...And so on: the sequence of obstructions corresponds to the Postnikov tower
$$
O(n)\gets SO(n)\gets Spin(n)\gets String(n)\gets FiveBrane(n)\gets...
$$
(this is a kind of duality: one can think either about sequence of extensions of the section through the filtration of $M$ by skeleta, or about sequence of lifts through the Postnikov tower of $O(n)$).
Some references. Obstruction theory in general is discussed in the section 4.3 of Hatcher — but Hatcher uses the Postnikov-towers-approach (like in the second part of the answer), AFAIR. And more classical approach + obstruction-theoretic POV on characteristic classes is explained e.g. in section 12 of Milnor-Stasheff, I believe.
One more remark. As it is explained in the other answer, ordinary ("primary") characteristic classes can't answer the question, since they coincide for stably equivalent vector bundles. What obstruction theory gives is, in a sense, a theory of higher characteristic classes: secondary class (a priori) defined only if primary one is zero and so on.
Some good $($introductory$)$ sources, in general, for all things smooth manifolds:
- Topology from the Differentiable Viewpoint, by Milnor
- Differential Topology, by Guillemin-Pollack
- Differential Forms and Applications, by Do Carmo
- A Comprehensive Introduction to Differential Geometry, Vol. 1, by Spivak
- Introduction to Smooth Manifolds, by Lee
- Foundations of Differentiable Manifolds and Lie Groups, by Warner
- Brian Conrad's Differential Geometry Notes
1.
Easy examples of parallelizable manifolds are $\mathbb{R}^n$, the tori $\mathbb{R}^n/\mathbb{Z}^n$ $($the points are cosets of the additive subgroup $\mathbb{Z}^n$ of $\mathbb{R}^n$, and the charts are open subsets of $\mathbb{R}^m$ that contain at most one point in each equivalence class, with each point mapping to its equivalence class$)$, and the argument used here to show $SO(n,\mathbb{R})$ is parallelizable $($$SO(n)$ is parallelizable$)$ actually shows that any Lie group is parallelizable. $($If $X_i$ are linearly independent tangent vectors at the identity, then for any paths $\gamma_i(t)$ with $\gamma_i'(0) = X_i$ we note that the paths $g\gamma(t)$ are smooth, and we will say that $V_i(g)$ is the equivalence class of $g\gamma_i'(0)$. Then each $V_i$ is a smooth vector field with no zeros, and the vector fields $V_i$ parallelize our Lie group.$)$
There are a lot of obstructions to parallelizability. One is the Euler characteristic. It turns out that any surface with nonzero Euler characteristic cannot have even a single smooth non-vanishing vector field. With algebraic topology one can show that a closed manifold with nonzero Euler characteristic cannot have a non-vanishing vector field. This includes genus $g$ surfaces for any $g \neq 1$. Another obstruction to paralleizability is non-orientability: every parallelizable manifold is orientable. Perhaps this is easier to see: given a parallelizable manifold with vector fields $X_1, \dots, X_n$ forming a basis for the tangent space at each point, we can always reverse the orientation of a connected chart so that they form a positively oriented basis at some point, and by continuity, at all points in each chart $($since determinants and the vector fields $X_i$ are continuous, and our charts are connected$)$. Then the transition maps will always have positive determinant, since the basis $X_1, \dots, X_n$ at each point is positively oriented at all points in all charts, and gets taken to itself via transition maps. So for example, the Klein bottle, Möbius band, $\mathbb{P}^n(\mathbb{R})$ for even $n > 1$ cannot be parallelized.
2.
Suppose the tangent bundle of $M$ is trivial; then our diffeomorphism $\rho^{-1}: M \times \mathbb{R}^n \to TM$ gives us vector fields $\rho^{-1}(M \times \{e_i\})$, $1 \le i \le n$ where $e_i$ are the standard basis coordinates. By hypothesis, the vectors $\rho^{-1}(p, e_i)$ are smooth functions of $p$ in local coordinates and are linearly independent at each $p \in M$. Conversely, suppose we have $n$ vector fields that are linearly independent at each point; then the map that takes each point $(p, \xi)$, $\xi = (\xi_1, \dots, \xi_n) \in \mathbb{R}^n$, to the tangent vector $\sum \xi_i X_i(p)$ is easily checked to be bijective, smooth, and have derivative of rank $2n$ at all points, and is thus a diffeomorphism $M\mathbb{R}^n \to TM$.
Best Answer
$S^2$ is not parallelizable. This fact is famously known as the Hairy ball theorem.
On any coordinate patch $U$ with coordinates $(x^1, x^2, \dots, x^n)$, the vector fields $V_i = \frac{\partial}{\partial x^i}$ are linearly independent. But when you cover a manifold with multiple coordinate patches, there may not be a way to extend those vector fields to the entire manifold and keep them linearly independent (or nonzero).