Crate training is a great way to housebreak your dog and teach them to be comfortable being alone.
The general rule of thumb is that a dog should not be left in a crate for more than 4-6 hours at a time.
There are a few exceptions to the 4-6 hour rule.
If your dog is showing signs of distress while in a crate, such as barking, whining, or scratching, it's time to let them out.
You can try covering the crate with a blanket to create a more den-like environment.
Start by introducing the crate to your dog in a positive way.