According to some stats I just read, an Compact car uses up to .16 gallons per hour idling. With a 4 to 5 liter car will use twice that. If you have a small car with a lets say 12 gallon tank and it was about full when you started, you could idle for about 75 hours. With a larger car with say a 20 gallon tank you might be able to idle for nearly 60 hours. BUT it would be foolish to idle the entire time. A better strategy would be to idle for no more than 15 minutes with the heater on full blast and then shut it off for at least 15 minutes before restarting. Don't let the car get too cold or it will be hard to heat up again. This should about double your survival time with what ever fuel you have onboard.
If you have electric car the protocol is simple, you are going to freeze to death in a few hours. You best be making friends with someone with a an ICE engine and full tank to share their car. You might be able to convince them that your body heat could be a help.

Don't run the battery down trying to heat the car, you are going to need the reserve battery power to drive the thing off if and when the road is clear. Otherwise you are going to be in for a big tow bill.