(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.
I don't know of a totally elementary proof of this result, but here is some context for it. More generally, an $n$-manifold $M$ (without boundary) has a classifying map $f : M \to BO(n)$ for its tangent bundle. Knowing when $M$ is parallelizable is equivalent to knowing when $f$ is null-homotopic. There is a general machine for doing this involving lifting $f$ higher and higher through the stages of the Whitehead tower of $BO(n)$, and it tells us that the complete set of obstructions to solving this problem are a set of cohomology classes in $H^k(M, \pi_k(BO(n)), k \le n$, each of which is well-defined provided that the previous one vanishes, such that $f$ is null-homotopic iff all of the classes vanish.
The construction of the first such class goes like this. Assume for simplicity that $M$ is connected. The first question is whether $f$ lifts to the universal cover of $BO(n)$, which is true iff $f$ induces the zero map on $\pi_1$ by standard covering space theory. Now, $\pi_1(BO(n)) \cong \mathbb{Z}_2$, and the induced map on $\pi_1$ gives a homomorphism $\pi_1(M) \to \mathbb{Z}_2$ which corresponds precisely to the first Stiefel-Whitney class $w_1$. This class vanishes iff $f$ lifts to the universal cover of $BO(n)$, which is $BSO(n)$, iff $M$ is orientable.
Now we want to try lifting $f$ to the $2$-connected cover of $BSO(n)$; this is analogous to the universal cover but involves killing $\pi_2(BSO(n)) \cong \mathbb{Z}_2$ (for $n \ge 3$) instead of $\pi_1$. Whether this is possible is controlled by the map
$$BSO(n) \to B^2 \mathbb{Z}_2$$
inducing an isomorphism on $\pi_2$. This is equivalently a universal characteristic class in $H^2(BSO(n), \mathbb{Z}_2)$ which turns out to be precisely the second Stiefel-Whitney class $w_2$. This class vanishes iff $f$ lifts to the $2$-connected cover of $BSO(n)$, which is $BSpin(n)$, iff $M$ has a spin structure.
The first surprise in this story is that (when $n \ge 3$) $BSpin(n)$ also turns out to be the $3$-connected cover; in other words, $\pi_3(BSpin(n)) = 0$, so the next step of this story involves $\pi_4$ and can be ignored for $3$-manifolds. If $M$ is a $3$-manifold, not necessarily compact, admitting both an orientation and a spin structure, then the classifying map of its tangent bundle lifts to a map $M \to BSpin(3)$, but since the latter is $3$-connected any such map is nullhomotopic. So:
A $3$-manifold, not necessarily closed, is parallelizable iff the first two Stiefel-Whitney classes $w_1, w_2$ vanish iff it admits an orientation and a spin structure.
To give an indication of the generality of this machinery, for $4$-manifolds the next step involves computing $\pi_4(BSpin(4)) \cong \mathbb{Z}^2$ and then lifting to the $4$-connected cover of $BSpin(4)$, which is called $BString(4)$. This says that the next obstruction to a $4$-manifold with an orientation and a spin structure being parallelizable is a pair of cohomology classes in $H^4(M, \mathbb{Z})$ which I believe turn out to be the Euler class $e$ and the first fractional Pontryagin class $\frac{p_1}{2}$ (a certain characteristic class of spin manifolds that when doubled gives the Pontryagin class $p_1$) respectively. Since $H^4(M, \mathbb{Z})$ is always torsion-free for a $4$-manifold, the conclusion is that
A $4$-manifold, not necessarily closed, is parallelizable iff the characteristic classes $w_1, w_2, e, p_1$ all vanish iff it admits an orientation, a spin structure, and a string structure.
And for $5$-manifolds and higher we really need to talk about $\frac{p_1}{2}$ and not just $p_1$.
The second surprise in this story is that for closed $3$-manifolds the condition that $w_2$ vanishes is redundant: it is implied by orientability by a standard computation with Wu classes. In other words, closed orientable $3$-manifolds automatically admit spin structures. I don't have a good intuitive explanation of this; it comes from a relationship between the Stiefel-Whitney classes, Steenrod operations, and Poincaré duality that I don't understand very well.
Best Answer
Some good $($introductory$)$ sources, in general, for all things smooth manifolds:
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$.