It can take some time to find a suitable replacement migrant domestic worker (MDW) and arrange for her to come to Singapore, so you should aim to apply for a work permit at least one month before the work permit of your current MDW expires.
Upon the approval of your new MDW’s work permit, you only need to cancel your current MDW’s work permit just before you get the new MDW’s work permit issued.