You can leave it plugged in as long as you want. Not like the block heater is capable of heating the engine hot enough to do any damage. As for how long you need to plug it in before cranking, well that will boil down to what kind of shape your engine, batteries, etc are in. I know with my 99 cummins 24v if I left it sitting and went to start it anything much below -5f it wasn't happy with me but would start. Now -15f unplugged forget it.