When publishing a paper, I normally go through the following stages (which I imagine are fairly universal):
Figuring out the solution to a new problem and writing it down.
Polishing up the manuscript until all of the coauthors are happy.
Putting the preprint on arXiv and any number of other repositories.
Submitting the paper to a journal (or several journals, if the first one rejects).
Revising the paper until the referee is happy, and getting it published.
Suppose that at some point in this process I move from University A to University B. When is the exact point where I should change the affiliation listed on the paper from A to B? This type of question has come up several times for me, but luckily in all cases I was either fairly early or fairly late in the process and the answer was clear enough. Still, I feel like I should have a clear idea of when the transition happens, and, much to my embarassment, I don't.
(If it matters, the field is pure mathematics.)