Well, the school will be pissed off for a start (unless you're an awful teacher and they can't wait to see the back of you).
In addition to that, you will probably be required to reimburse the school for the costs of work permit, teacher's license, admin staff's shoe leather, etc, etc. You can expect to cough up something in the region of 5,000 baht.
More importantly, once you quit a job, your work permit and one-year visa are null and void. You now have 7 days to leave the country and get a new visa.
Make sure that you keep tabs on exactly when the school hands back your work permit to the labor department, because that's when the 7-day clock starts ticking. I've heard numerous stories of schools failing to tell the teacher that they've already cancelled the work permit and the teacher suddenly staring at a hefty overstay fine.
Needless to say, breaking a contract is something you really should avoid doing if at all possible.
Paully also adds the following - In addition to the advice already given, remember that if your written employment contract has a notice period clause in it (as is common), for example, allowing your employer or you to terminate the contract on one month's written notice to the other party, you are NOT breaking your contract by giving your employer one month's written notice of leaving.
You are terminating your contract by agreement. This is as valid in Thai law as in US or UK law.
Your employer may still be pissed off, but there's nothing in law he can do about it other than try to hold up your application for a new work permit.
Keep a copy of your letter of notice and contact the Ministry of Labour if your old employer refuses to give you the Min of Labour a release form (Tor Dor 11) agreeing to your leaving and allowing you to get a new work permit.
Update from a teacher regarding the '7-day rule'
In my case, the employer wrote on whatever form it was that they presented to the Labour Department that my last date of employment was 12 June.
They actually notified the Labour Department on 14 June and subsequently notified Immigration on 15 June. Immigration gave me until 18 June (ie, the clock started ticking the first second into 12 June) to leave the country.
I was expecting a date of 21st June, so this was a bit of a surprise, but not a problem.