There is no set amount of time for training. The end result will also depend on the individual dog. I have a 13 year old dog I raised from 4 weeks of age who spent her first year in a crate whenever we weren’t home. After that the crate remained in her environment with the door open, for her to use at will for 3–4 more months. She was transitioned out of the crate, letting her roam the house with no one home a bit longer each time, then eventually for an extended period. To date it’s been a success. No destructive behavior, no separation anxiety, and no lapses in her housebreaking.