How long does it take to produce a star? Why does it take that long?
The time to "produce" a star actually depends on the mass of the star. Let's start with a solar type star.
For a typical solar type star, the formation time is about 10 million years (you can see this image on Wikimedia that gives an overview of the star formation process, adapted from Philippe André's figure in Observations of protostars and protostellar stages in The cold Universe, 1994). You can distinguish different epochs in the star formation process, that are the signature of different dominant physical processes. The very first stage of star formation is a gravitational collapse that leads to the formation of the protostar itself. The timescale for this collapse is the so-called free-fall time which depends only on the density of the object. When you get a central object in a hydrostatic equilibrium, things become more subtle: the core will contract adiabatically (without heat transfer) and when a temperature of about 2000 K is reached, dihydrogen dissociates (which is a highly endothermic reaction) which leads to a second phase of collapse, leading to the formation of the protostar itself. It takes about 1000 years to get to this stage, from the hydrostatic core.
The next stage, the protostellar phase, is mostly an accretion phase. It means that the timescale for this epoch is given by an accretion time, that varies with the accreted mass (which is quite low for a solar type star). It takes about 200 000 years to accrete 90% of the final mass of the star.
Then, since the star is still contracting, the temperature at its center is increasing; when a temperature of 1 million Kelvin is reached, the protostar starts to burn its deuterium. At this stage, the Kelvin-Helmholtz mechanism allows the protostar to contract and to radiate away its gravitational energy. The meaningful timescale is then the Kelvin-Helmholtz time (which varies as the square of the mass and the inverse of the radius and the luminosity), that is much longer than the previous timescales. Temperature continues to rise, up to 10 million Kelvin, when hydrogen eventually starts to burn, which is the birth certificate of a star. It takes around 10 million years to get to this point.
But, as I said, this scenario depends on the mass of the star. It is valid for Sun-like stars, but not quite for massive stars. It is much faster for massive stars, and the star formation process is quite different. In particular, the accretion rate is much higher, the radiation pressure of the protostar is insanely higher, and their interplay is not completely understood. However, there are some theroretical works that gives an estimate of about 100 000 years to form a massive stars (see for example works from McKee and Tan).