As I understand it, you are required by law to tell them at least 10 weeks before you plan to start your maternity leave.

I am not sure about when you would have to tell them if you are not going back, but I would think it would be the same notice as if you were resigning so whatever that is at your company?