When do I need to stop working if I am pregnant?

At delivery . In a normal pregnancy without complications most patients can continue to work until they go into labor. There is no benefit to taking off early. It is best to stay active and busy. Stopping work early can also cut into your maternity leave and decrease the amount of time you get to spend with your new baby after delivery.
You don't. If you pregnancy is going well, without any issues, you could work up until your due date if need be.