When to do it? Most of the time, this only comes up at the end of an interview or in the second or third interview. The reason being that it only becomes a discussion point when both parties are pretty sure they will be working together. So don't bring it up prematurely until you get a good feel that you have the employer very interested in you, or they bring it up first
Being prepared and having information is vital in negotiating your salary and other terms of your employment. You should note that employment negotiations are not like bartering or buying a car. You may end up working with your negotiator on a daily basis if things go well, so even though you'll want the best deal possible, you should proceed in a diplomatic manner.
Figuring out where you stand relative to other candidates for that position is vital to your negotiation strategy. If you're at the final interview and feel you're top in the running for the position, you should be able to negotiate according to your terms. If, however, you know you're only one in a pool of potentials, salary terms could be the deciding factor in hiring you, so think carefully before you aim too high.