Arduino Wire.onReceive(handler) It says in the description of the function:


  Registers a function to be called when a slave device receives a transmission from a master.


So when does it exactly called? I guess it's not been called for each byte, but its the meaning of receiving transmission from the master. Does it called for each byte? When the master use transmissionBegin? transmissionEnd?
It is called at the end of the reception of the entire packet - i.e., when the slave receives the final STOP bit.  It is passed the number of bytes received (which is the number of bytes you requested since I2C has no way of being able to work out if it is actually receiving real data - see here) as the only parameter so you know how many bytes you can then read from the internal buffer without overflowing it.