There is no exact answer for your question as it varies a great deal person to person.
Conventional widsom though is that as soon as the cavity
has begun, get it fixed right away....Waaaaaayyyy before it gets to the pulp of the tooth! early treatment is very comfortable, much more simple, and exponentially less expensive. So if you have a cavity go now...Not later.