Can I resign from my employment contract anytime I want?

I have got any employment offer through a recruitment agency for a company based in Dammam, Saudi Arabia.
Can I resign from my employment contract anytime I want? Or I will be bound to serve the company till 2 years?
If I join their company on their sponsored visa, suppose after 6 months if I get new employment then will I be allowed to move on (resign) or I will be bound till 2 years of visa???

Please read your contract clauses/T&Cs in detail. Nothing bars you from leaving a job in general.