Most jobs are covered by the Labor Standards Act. If this includes your job, you need a reason to terminate the contract as in Art. 14, for example if your employer underpays you.
If the contract says you can terminate it for another reason, you can.
If you leave without properly terminating the contract, you can get in trouble.
If in doubt, ask the labor department or a lawyer.