It depends very much on what's turned on, as several folks have said. With a bare minimum of one NAV and COM plus the TC and basic instruments, you can keep going for a surprisingly long time.
If you leave your transponder on, it's a lot less, and if you use pitot heat it's a very short time indeed. In effect, you don't need pitot heat at all, because you'll be out of power so quickly you might as well not have bothered.
I had an alternator failure in IMC (in MiG alley) some years ago, and scary it was! That was in a C172.
I "load shed" quickly, but had to keep some stuff on to navigate with. The COM TX stopped after about 10 minutes, but by then Gatwick Approach knew what was up, and the receiver carried on fine so I just followed instructions.
An excellent controller coordinated a speedy diversion, and I was on the ground at Biggin 15 minutes after the alternator went "offline", still with a working VOR and a COM receiver, plus the electric turn coordinator. But I was very glad the AH and DI were vacuum operated.
It was a flapless landing. No drama. An engineer at Biggin fixed the problem in about five minutes, used a "trolley" to restart, and we were on our way.
I wouldn't want to do that too often, though.