One of the last steps the underwriter will take before issuing a "clear-to-close" is a telephone call to your employer to verify employment.
If you change jobs while you are in underwriting, you could be forced to wait until after 30 days with your new employer. During this period, your application will be suspended by the lender. All date sensitive documents will expire (such as pay stubs, bank statements, etc) and will have to be re-supplied.
Your lender will also require a new Verification of Employment form from the new employer.
Any of these items could cause your application to be denied.
You also could be at risk for fraud if you accept new employment and fail to provide that information to your lender (Fraud by Ommission).
Changing jobs is one of the Top Five Ways to Crash and Burn on a Mortgage Application. Wait until after your loan closes.