-The employer can withdraw the I-140 any time they want to, but if you still work for them, they have no reason to withdraw it unless you mess up with them very bad (in this case, you may also be fired). Even if you quit the job, most employers normally does not withdraw the I-140 because there is no law to require them have to do that, and also they will not lose/gain anything whether they withdraw the I-140 or not.
If you quit the job after your I-485 pending is for > 180 days, then your I-485 will not be affected even fi the I-140 is withdrawn as long as your new job is in the same/similar field as the old one.