I have submitted my dissertation recently (in mathematics), and I have a position for a postdoc which I will start around October.
In the meantime, one of my friends and I have been working on some projects (some of which we began nearly a year ago), and prepare to write some papers. At least one of them we expect to finish over the summer, and that's fine, there's no hard choices how to affiliate myself there: I'm still considered a student.
But the second paper we have been working on is probably going to take longer than that before we are ready to publish it. So both of us will be moving on from our current university.
How do we decide which affiliation to use when we finally make the paper public? Do we take it as the affiliation at the time, or the one under which we worked the most?
(To clarify, none of our papers are directly related to either of our dissertations.)