If circumstances change, and there is a basis to file for a change of custody, don't delay - or else Judge may think you've acceded to the situation.
File for change of Custody as the situation arises
I had a potential client recently come into my office, who informed that the child wasn't happy living with her father, and often was passed off to the paternal grandmother to stay with. The situaiton had already persisted for a few months like that. I advised her to file for a change of custody right away. The longer the situation persists, the more the Judge will think the non-custodal parent was o.k. with the situation - or at least didn't feel it was enough to bring to the Judge's attention.
Move quickly - but not too quickly
That said, you should make sure before filing that the circumstances do indeed establish a likelihood the Judge will change custody. As such, sit down at a consultation appointment with an experienced child custody lawyer. I do not know how many people sit down with me at a consultation, tell me they've already filed for a change of custody - and then ask whether they have a basis to do so or not (usually phrased as: "do you think I have a good case?"). This discussion should occur before you file.