The time for formation of a cavity varies in terms of certain factors including age, type of diet, observing oral sanitary instructions, etc. On average, it would take between six months to four or five years for a cavity to reach a point where it needs treatment.