When writing in Russian, every time when they switch between typing prose and typing equations or code. So, maybe about a dozen times per sentence.
At first my jaw dropped on your comment, but then I thought, maybe we non-latin-writing people are just abusing a feature meant for something different? Do you use several layouts, but switch between them infrequently?
Honestly I wouldn't be surprised if people assume that non-latin languages have all the characters you need to type in that language on a single layout. For English at least, you really only use a single layout.
In various non-european scenarios, possibly multiple times per sentence. For example, including the word "Microsoft" or "Linux" in the middle of non-latin script requires two keyboard layout switches, to latin and back.
I code on US keyboard, but i write mails and documentation for work on Slovenian keyboard.
It's not bad if you focus on one or the other. But when you combine the two, (talking about techical stuf, tickets, code reviews, ...) I often have to switch.
I'd say i switch on average few dozen times per hour.