The Basic Conditions of Employment Act sets notice by length of service. One week during the first six months of employment, two weeks after six months but before twelve, and four weeks once you have been there a year or more. Farm and domestic workers move to four weeks after six months rather than twelve.
The same periods apply in both directions, so an employer dismissing you owes the same notice you would owe them. Notice has to be in writing unless the employee cannot write, and it runs from the day after it is given.
A contract can require longer notice, and calendar-month notice is common in senior roles, but it cannot require less than the Act. Where a contract is silent, the Act applies by default.
Two practical points. Annual leave cannot be used to run out a notice period unless both sides agree, so taking leave instead of working notice is a negotiation rather than a right. And an employer may pay you in lieu of notice instead of having you work it, which is lawful, but it must be the full amount you would have earned in that period.