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 ABC Co., 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.