Unless it is titanium, most people recommend after 8 hours of sewing it should be replaced. Titanium needles last about 5times longer.
A good rule of thumb is to know that it is already too late when you hear the popping sound as it goes into the fabric. Definitely change it then.