You want to proceed carefully here. While it's an exciting time, there's potential for doing real harm if you misstep. There are two cardinal rules that govern when and how to tell your employer that you're resigning.
Cardinal Rule No. 1: Never Give Notice Until You Have Accepted a Formal Job Offer
Too many people give notice when they're "pretty sure" that an offer is coming their way, or when they've only received an informal offer. This can be a huge mistake, because offers fall through all the time. No matter how promising things look with a prospective employer, things can and do change. The company might have a hiring freeze, or a new manager might come in and cancel the position, or the company might hire an internal candidate at the last minute. And if that happens and you've already told your current boss that you're leaving, she's under no obligation to let you rescind that notice. Your current company may have already started moving forward with plans for filling your position, and you won't necessarily get it back.
What's more, not only should you never, ever count on an job offer until you actually have it, preferably in writing, but you shouldn't count on it until you've accepted it too. That's because it's possible that you won't be able to come to terms with the company on pay or benefits or start date, and your negotiations could fall apart. So you want to make sure not just that you have an offer, but that you've formally accepted that offer. Only then should you give notice at your current employer.
(The exception to this is if you have an excellent relationship with a boss who you know will take the news well and not push you out earlier than you're ready to leave. If you're lucky enough to be in that situation, you can feel safer giving your boss a heads up that you're thinking about leaving.)
Cardinal Rule No. 2: The Amount of Notice You Give
Most people know that professional convention requires them to give at least two weeks notice, but many people wonder about giving more. If circumstances allow you to give your company a more generous notice period, should you?
The answer depends 100 percent on how your manager and your company operate. How have they handled other employees who resign? Are people shown the door immediately? Pushed out earlier than they would have otherwise planned to leave? If so, it's safest to assume that the same may happen to you and give two weeks and nothing more. But if your employer has a track record of accommodating long notice periods, has been grateful to employees who provide long notice, and has generally shown that employees can feel safe being candid about their plans to leave, take your cues from that.
Of course, both of these rules would be unnecessary if employers handled departing employees differently. It's actually in employers' best interest to make it safe for employees to give longer notice periods, but too few of them do. As a result, employees need to make sure they protect themselves.
Alison Green writes the popular Ask a Manager blog, where she dispenses advice on career, job search, and management issues. She's also the co-author of Managing to Change the World: The Nonprofit Manager's Guide to Getting Results, and former chief of staff of a successful nonprofit organization, where she oversaw day-to-day staff management, hiring, firing, and employee development.