When one finishes a degree or a research position, the boss asks to carry on sth unfinished (unpaid), does one need to agree to do so?
No, you don't need to agree to do it at that point, unless you already have agreed or committed previously. However, for your future career it would be good to give it some consideration, at least, and to work in in if possible.
I'm assuming that "the boss" is a professor, actually, who can aid you in the future.
But "unpaid" is a big issue. If you can get something back for your efforts either hard currency or academic currency it would be a good thing also.
No. And profs typically "lose" some work because of this. It is just a function of the system. I wouldn't cry about it either as you have your life to attend to.
I definitely would not stay at school doing this versus going to a job. Or forego some "break" vacation type activities before your real job starts.
I would draw the line at doing any new experiments. But writing something up is different. It can benefit you also. But you now have a little more control in the situation. Don't be obvious about it, but do it on "your terms".
If you are still in academia, figure out a way that it benefits you (e.g. continued collaboration). But concentrate on "WIIFM". You don't have to be prickly. But just only do things in away that benefit you. Not guilt trip over unfinished work. (The universe will always have unfinished work and it's not like the prof is in the lab on Xmas , head down over the bench, to make sure 100% work is finished and 0% grant money wasted. Of course science wants a high return on investment, but some waste is normal. And you need to look out for you, not the PI, not the agency. (If they REALLY cared, they would pay!)