Most puppies can hold on from quite young (8-12 weeks ) all night if they need to and the crate is small enough because they see it as their bed and will try not to toilet in there. The reason they don't hold on in the day is that they don't have to and they aren't sure where to go, so just go anywhere pretty much.
Some puppies can't hold on all night and you can choose to either set your alarm and get up once or twice during the night, use a crate that will fit the puppy as an adult and put the bed at one end, paper/puppy pad at the other (this is different to normal paper training as it is just giving the puppy somewhere to go that isn't on the floor and as the puppy grows and their bed then takes up the whole crate they will automatically stop going there) or just leave the puppy overnight and if they have an accident wash the bed in the morning. I personally find that most puppies can hold on most of the time all night and accept the occasional accident, but if they really can't then use the paper in the crate method.
If you use a crate you usually also have to train the dog to accept being shut in there though, this is easier for some dogs than others. Crates must never be used as a punishment or to confine for long periods during the day, but they are invaluble when chewing starts or to give the dog a safe haven if you have children.