Tamagotchi versions 1-4.5 do not evolve in their sleep, neither do the ones from the japanese tamagotchi plus group.
I'm not sure about v5 and 5.5.
Tamagotchi versions music star and tama-go do evolve in their sleep.
I don't think vintages evolve in their sleep, and I do not know about the colour versions.
One note about the versions that don't evolve in sleep;
If evolving time passes while your tamagotchi is asleep, he/she will evolve first thing in the morning after waking up.
It is however possible that the character your tamagotchi evolved into wakes up later that the one it was before evolving and if this is the case, your new character will go back to sleep right after evolving.
When this happens, it appears your tamagotchi evolved in his/her sleep, although that is not the case. He/she woke up normally, evolved normally, and then started sleeping again.