When will gravitational collapse occur? There are two main sources of energy: gravitational and kinetic. Gravitational will lead to contractions, kinetic creates expansion through gas pressure.
Take a cloud with mass $M_c$ and radius $R_c$. The gravitational potential energy is approximately:
$$\begin{equation}
U \sim -\frac{3}{5}\frac{G M_c^2}{R_c}
\end{equation}$$
The kinetic energy of $N$ particles will be approximately:
$$\begin{equation}
K = \frac{3}{2}N k T
\end{equation}$$
Recasting this in terms of the mean molecular weight, $\mu$,
$$\begin{equation*}
N = \frac{M_c}{\mu m_H}
\end{equation*}$$
If the kinetic energy is than half the gravitational energy, then collapse will be possible.
$$\begin{equation}
\frac{3 M_c k T}{\mu m_H} \lt \frac{3}{5}\frac{G M_c^2}{R_c}
\label{eq:conditionforcollapse}
\end{equation}$$
The radius of the cloud $R_c$ can be expressed in terms of the initial mass density:
$$\begin{equation*}
R_c = \left( \frac{3 M_c}{4 \pi \rho_0} \right)^{1/3}
\end{equation*}$$
Which when substituted back into \eqref{eq:conditionforcollapse}, we get:
$$\begin{equation}
M_J \simeq \left( \frac{5 kT}{G \mu m_H}\right)^{3/2} \left( \frac{3}{4 \pi \rho_0} \right)^{1/2}
\end{equation}$$
This is the Jeans mass.
Or, in terms of a Jeans length,
$$\begin{equation}
R_J \simeq \left( \frac{15 k T}{4 \pi G \mu m_H \rho_0} \right)^{1/2}
\end{equation}$$
A more thorough treatment would have to include the pressure from the surrounding ISM. The Bonner-Ebert mass captures the physics of this added complexity:
$$\begin{equation}
M_{\textrm{BE}} = \frac{c_{\textrm{BE}} v_T^4}{P_0^{1/2} G^{3/2}}
\end{equation}$$
where $v_T \equiv \sqrt{\frac{kT}{\mu m_H}}$ is the isothermal speed of sound. $c_{\textrm{BE}}$ is a dimensionless constant approximately equal to 1.18.
Free fall collapse
The basic equation of motion for a gravitational system:
$$\begin{equation}
\frac{d^2 r}{dt^2} = - G\frac{M_r}{r^2}
\end{equation}$$
Some differential equations leads to:
$$\begin{equation}
t_\textrm{ff} = \left(\frac{3 \pi}{32}\frac{1}{G \rho_0} \right)^{1/2}
\end{equation}$$
Speed of sound
$$\begin{equation}
t_\textrm{pressure} = \frac{r_0}{c_s}
\end{equation}$$
and the speed of sound is:
$$\begin{equation}
c_s = \left( \frac{\gamma k T}{\mu m_p}\right)^{1/2}
\end{equation}$$
$$\begin{equation}
\left( \frac{3 \pi}{32 G \rho_0}\right)^{1/2} < r_0 \left(\frac{\mu m_p}{\gamma k T} \right)^{1/2}
\end{equation}$$
Jeans Length
$$\begin{equation}
r_J = \left( \frac{3 \pi \gamma k T}{32 G \rho_0 \mu m_p}\right)^{1/2}
\end{equation}$$
Star Formation
Perturbation
A shockwave from a nearby supernova can trigger the gravitational collapse. The molecular cloud collapses.
Collapse
However, it cannot collapse for ever, since the angular momentum will be conserved, and as it gets smaller, its rotates faster.
$$\begin{equation}
\frac{GM}{r_f^2} = \frac{v_f^2}{r_f}
\end{equation}$$
Hot gas moves out
Nuclear Fusion Begins
A star (like our sun) is born
Main sequence life
Leaving the Main sequence
Red Giants
He Flash
Asymptotic Branch
Planetary Nebula
White Dwarf
The final form of a sun like star is a white dwarf. Our sun will eventually loose about 40% of its mass, and will spend the next trillion years just cooling down - no more fusion.
What
Time
Activity
Protostar
50 Myr
Gravitational Attraction
Main Sequence
10 Gyr
Fusion of H to He in the core
Red Giant Branch
1 Gyr
Fusion of H to He in shell
Horizontal Branch
100 Myr
Fusion of H to He in shell, He to C in core
Asymptotic Giant Branch
20 Myr
Fusion of H to He in outer shell, He to C in inner shell