In standard model Lagrangian it is not possible to introduce a bare mass term for quarks of the form M qbar q; this will break gauge invariance. Quarks get mass due to Yukawa couplings to the Higgs field. Therefore the VEV of Higgs field sets a characteristic mass scale for quarks. There are six quarks and three leptons which are massive. If there is only one Higgs field which couples to all of them ( as in the minimal case) , then the relative mass differences among them are due to respective differences in Yukawa couplings to the Higgs field.
P. W. Higgs, Phys. Rev. Lett. 12, 132 (1964).
P. W. Higgs, Phys. Rev. 145, 1156 (1966).
F. Englert and R. Brout, Phys. Rev. Lett. 13, 321 (1964).
G. S. Guralnik, C. R. Hagen, and T. W. Kibble, Phys. Rev. Lett. 13, 585 (1964).
Most of the mass of the quarks comes from their strong interactions, however; and quantum chromodynamics does have a, non-trivial, scale: it's not scale invariant, since the β-function isn't zero-except at the origin. The characteristic scale is known as Λ_QCD and is of the order of 200 MeV: http://www.int.washington.edu/PROGRAMS/12-2c/week1/hasenfratz_03.pdf
At higher energies quarks can be resolved-at lower energies only bound states thereof, hadrons, can.
Highly inelastic collisions between electrons and quaris inside protons and neutrons showed durint the 1966 to 1968 SLAC experiment that up and down quarks are only marginally more massive than electrons.
It was during those experiments that the only scatterable inner components of protons and neutrons were identified.
Ref: Breidenbach M. et al. (1969). Observed Behavior of Highly Inelastic Electron-Proton Scattering. Phys. Rev. Lett., Vol. 23, No. 16, 935-939.
The up quark was found to have a rest mass lying within the 1.5 to 5 MeV/c¨2 and the down quark rest mass found to lie between 3 and 9 MeV/c¨2
Ref: CRC Handbook of Chemistry and Physics, page 11-6
At maximum, the total mass of the 3 quarks inside a proton amounts to 2% of the proton total mass and the total maximum mass of the 3 quarks inside a neutron amounts to 2.4% of the neutron mass.
This leaves the remaining nucleon mass as most likely being velocity dependant relativistic mass due to the quarks near light velocitis on their tight closed orbits.