How Long Did It Take For The Sun To Form?
This timescale is not well defined. If you mean the time from initiation of cloud collapse to the beginning of hydrogen fusion, it is around 10 million years and determined by the Kelvin-Helmholtz timescale of the contracting protosun.
If however you mean the timescale of cloud collapse to a revealed protostar with perhaps a disk around it, this is an order of magnitude shorter. The previous phase of collapse to a core with a roughly spherically symmetric envelope is about an order of magnitude shorter again.
These timescales are estimated with respect to the first one by counting relative numbers of objects in each phase. So the absolute number depends on how well we understand the ages of young stars on their approach to the main sequence, and these could be wrong by a factor two (for various reasons to do with atmospheres, rotation and the presence of magnetic fields).
The timescales above are for stars of a solar mass. It is probably a factor of a few longer for lower mass stars and is several times quicker for higher mass stars.
As to your second question, collapsing clouds and protostars are governed by convective heat transport. This efficiently mixes the gas, such that protostars are expected to be initially chemically homogeneous. However, there are various mechanisms that can chemically fractionate the material in a circumstellar disk; gravitational settling to the midplane is one of them.