The last time I had a sprained ankle I had to wear the boot for the sprained ankle for 6 weeks.
After 6 weeks I no longer had to wear the boot and could go back to my normal shoes.
After you sprain your ankle you should take it easy for at least the 6 weeks to allow your sprained ankle to fully heal so you won't cause anymore problems and injure your ankle any further.
The boot for a sprained ankle limits motion, provides protection, and helps reduce pain and also keeps the ligaments and joint in place while they heal.
Some people may only need to wear the boot for 2 weeks while others may need to wear the boot or brace etc for 6 weeks.
It depends on how severe the sprain is.