When do mutations in NEAT occur?
When does the mutation occur and how does it take place? 


Finding a solution in NEAT algorithm is based on evolution strategy. It means that you have Neural Networks which are yours individuals, so mutations and crossing occurs in loop after phase of "fitnessing" (calculation fitness for every individual and removing bad ones).


  How is it chosen whether to add a node or to add a connection mutation? Furthermore, how is it chosen where the mutation is taking place in the network (between which connections)?


Randomly: just draw. You can read more about evolutionary algorithms here.

If it could somehow help, I include link to my repository with the implementation of NEAT.