Usually you can work as long as you want if the doctor doesn't say otherwise. I originally wanted to start my leave on May 15th, due may 20th but my doctor says she's measuring ahead so I'm starting my leave May 1st
Everyone is different. You stop working when you feel you need to stop working. I am 37+1 and will be done work Friday. Sometimes I wish I stopped working earlier as I am very uncomfortable all the time. But it's up to you and your body what you can handle