It depends on the specific terms and conditions of your employment contract. In general, an employer cannot hold you to a contract if you are an at-will employee, meaning that either the employer or the employee can terminate the employment relationship at any time, for any reason, with or without notice. However, there may be certain exceptions to this rule, such as if you have signed a contract that explicitly states that you cannot resign during a certain period of time.
If you are concerned about whether or not you can resign from your job, you should speak to an employment lawyer or review your employment contract carefully.