However, a good rule of thumb is 4-6 hours for temperatures below -10°C (14°F). In milder temperatures, like just above freezing, you may only need 2-3 hours or even less. For significantly colder temperatures, you might extend it slightly, but leaving it plugged in overnight is generally fine.
Overdoing it isn't harmful: The heater is designed to only draw enough power to maintain a temperature within a safe range for the engine block. It won't overheat or damage anything if left plugged in longer than necessary. It simply becomes less energy-efficient past a certain point.
The biggest risk of *under*heating is: Starting the engine when it's extremely cold and the oil is very thick can cause increased wear on your engine.
Ultimately, it's best to observe how long it takes for your specific truck to warm up sufficiently in your climate. If you start it and the oil pressure takes a long time to build, or if you notice unusual noises, you may need to increase the time the heater is plugged in.