This might be a reference to the "dog-watch". Sailors used to do lookout on shifts through the day and night, doing four hours at a time, and each shift was called a "watch". But the shift from midnight to 4am was split into 2 2-hour shifts called a "dog-watch". So maybe someone did six hours (three dog-watches) in one go.
As bernardo says it's a reference to the dog watches. In bad weather sailors were called on deck regardless of whether it was their watch or not to trim the sails, hence a three dog night is a long night on duty
A "three-dog night" is a night that is very, very cold. It comes from either Australian (Aborigine) or Canadian (Eskimo) culture, depending on which source one consults. The underlying concept is that you need to cuddle up with three of your dogs in order to keep warm.