An employee's employment contract will define the notice period they must give their employer in order to terminate their contract of employment.
The employee's employment can be terminated earlier by mutual agreement with the employer. However, quitting a job without notice and the prior agreement from the employer will be treated as a breach of contract. An employer can take the employee to court for breach of contract.