There are three common mistakes that people make when leaving organizations; one is merely an inconvenience but the others can harm a career.
The minor mistake is giving too much notice. In most instances, the departing executive or manager who gives more than a month's notice is going to find how quickly he or she is transformed into a lame duck. Communication dries up, fewer meetings are booked, and people soon begin to give those "Are you still here?" looks.
A more serious mistake is giving too little notice. The problem with this approach is it sows rumors that the departure was less than voluntary. This is compounded if the person fails to send out a farewell notice or permits the employer to issue a cryptic, "Samuel has decided to explore other career options" message. For many skeptics, "other career options" means a park bench.
The most serious mistake is to burn bridges. It may be very tempting to leave with a loud blast at the trolls and weasels who've made your life miserable, but the mysterious ways of life may someday cause you to need those people. Furthermore, leaving in such a manner is unseemly and prone to make outsiders suspect that there was something wrong with you, not the malefactors.
Circumstances may demand otherwise, but as a general rule, give no more than a month's notice (in most cases, two weeks are fine); send a pleasant, nicely-worded, farewell note to your co-workers and friends; and behave in a positive, professional manner that avoids any recriminations.
In short, act in a way that could be a model for future resignations.