Making Your Final Commitment
In the end, you will need to make a commitment. It should be a commitment that you are willing to stand behind. Companies spend money, commit resources, allocate training time, and shape schedules around your commitment. In addition, they will also be sending the "Dear John/Dear Jane" letters out to all of the "second-place" finishers. So make sure you are willing to stand behind your commitment.
Give Proper Notice
One of our tendencies in accepting a new position is to want to move right away. But even if the position is vacant at your new company, no ethical employer would ask a person who is already employed to start immediately. It is just not done. Even if you are not happy with your current employer (see "Don't Burn Those Bridges"), you owe them the professional courtesy of proper notice.
How long? Two weeks is standard in almost every industry. Your current employer may wish it were longer, but two weeks is the standard and is all that you are obliged to provide. In certain situations, an employer might decide to immediately dismiss an employee who is leaving. While federal and state laws vary as to whether they are required to pay you for your two weeks' notice, your best defense in this situation (if you believe it is a possibility) is to notify your new employer of the possibility: "Given my current situation at _____ (company name), it's possible that when I give notice they may ask me to leave immediately due to _____ (competitive reasons, just finished project, etc.). If that were to happen, would you like me to start with you right away?" This approach is especially useful if the position being filled is currently vacant.
Remember, don't get bullied into giving more than two weeks' notice unless you are absolutely sure this will fit your new employer's schedule. Only in extreme cases should you consider remaining more than four weeks after giving notice, unless, of course, your start date is later than that, which can often be the case with entry level hiring.
Don't Burn Those Bridges
No matter how awful your previous employer was, no matter how terrible your boss was, no matter how evil your coworkers were, never ever burn your bridges behind you! Even if you were the victim of sexual harassment or threatened with human sacrifice—take it up with the courts, but do not take it out on your boss or coworkers in person before you leave. The "take this job and shove it" attitude will get you absolutely nothing except a (very) temporary feeling of superiority. Even if you were treated unfairly, do not sink to their level to get even. The most respectable thing you can do (especially when it was rough) is to leave with honor and dignity. Keep your head up and keep your mouth shut. You will leave with respect instilled in your character rather than disgust instilled in your heart.
And yes, burned bridges can come back to haunt you—in ways you least expect. One man who felt he had every right to tell his boss exactly what he thought of him did exactly that. Imagine his shock and horror when this former boss was hired by his new company over four years later—as his new boss! Needless to say, he lasted only a few months before he ended up leaving for another company. Another young woman who told off her boss when leaving the company found herself having to work with her less than a year later on a committee as part of her professional association.
Remember, no matter how large your geographical view of the world, it is a very small work world out there. Even if your former bosses never have any contact with you, they may very well talk about you (negatively) to others—sometimes at every opportunity they get. So keep it civil and professional.
Look forward, not backward. If you really want to throw them for a loop, sincerely thank them for all the help they have given you. Do your very best work in the time you have remaining with the company, and make them realize what a true gem they are losing.