1. I will write a preface when I have finished the book.
and 2. I will write a preface when I finish the book.
Thank very much.
In practical terms there is not a great deal of difference.
In #1, the present perfect makes it clear that the writing will be done after the finishing.
In #2 it is possible that the writing will begin as soon as the book is finished.