The best time to negotiate salary is after receiving a job offer, and importantly before you accept a job offer - at the point when the employer clearly wants you for the job, and is keen to have your acceptance of the job offer. Your bargaining power in real terms, and psychologically, is far stronger if you have (or can say that you have) at least one other job offer or option (see the tips on negotiation). A strong stance at this stage is your best chance to provide the recruiting manager the justification to pay you something outside the employer's normal scale.
If there's a very big difference between what is being offered and what you want, say more than 20%, you should raise it as an issue during the interview for discussion later (rather than drop it as a bombshell suddenly when the job offer is made). Do not attempt to resolve a salary issue before receiving a job offer - there's no point. Defer the matter - say you'll need to discuss salary in due course, but that there's obviously no need to do so until and unless the company believes you are the right person for the job. "Let's cross that bridge when we come to it," should be the approach.
A job and package comprise of many different things - unless the difference between what's offered and needed is enormous (in which case the role is simply not appropriate) both sides should look at all of the elements before deciding whether salary is actually an issue or not.
The chances of renegotiating salary after accepting a new job, and certainly after starting a new job, are remote - once you accept the offer you've effectively made the contract, including salary, and thereafter you are subject to the organization's policies, process and natural inertia.
A compromise agreement on salary, in the event that the employer cannot initially employ you at the rate you need, is to agree (in writing) a guaranteed raise, subject to completing a given period of service, say 3 or 6 months. In which case avoid the insertion of 'satisfactory' (describing the period of service) as this can never actually be measured and therefore fails to provide certainty that the raise will be given.
If you are recruiting a person who needs or demands more money or better terms than you can offer, then deal with the matter properly before the candidate accepts the job - changing pay or terms after this is very much more difficult. If you encourage a person to accept pay and terms that are genuinely lower than they deserve or need, by giving a vague assurance of a review sometime in the future, you will raise expectations for something that will be very difficult to deliver, and therefore storing up a big problem for the future.