"He is happy when he writes a novel" means, he is happy when he is writing a novel.
The use of the present simple tense (he writes) expresses a routine or a habit, something we do, and not something we did.
Same holds true for "He is happy when he talks to a friend", which means, when he is talking.
:D

Academic