Quarks are elementary particles and so they didn't "form" at any point following the big bang -- they were already in existence along with the leptons and gauge bosons.
In the very early, hot universe, free quarks existed as part of the quark-gluon plasma. The strength of the interaction force between quarks drawing them together (the strong nuclear force) is weaker at higher temperatures, so in the early, hot universe quarks don't interact very much. However, as the universe cools and the strong nuclear force becomes relevant, quarks quickly form bound states like mesons and baryons.