In Brazil, if you (the employee) leave, you are legally required to do a 20 to 30 day notice (it varies according to whether you want to do full hours or a reduced period).
But that only happens if you are a legally registered full-time employee. Due to enormeous taxes, lots of employers and employees opt instead to be "long term contractors", in which case there is no law other than what is on the contract, but most places I worked on this scheme expect you to do some reasonable notice (and prospectant employers also comprehend that you may need that, since you may be binded by the law mentioned on the first paragraph.