Until swelling goes down.
I would say 2-5 days, with of course ice packs on the pain spot every now and then. After 2-5 days, if your ankle is either feeling worse, or the same, you may have something worse like a torn...
Above your heart if you are laying down and above the belly botton if sitting down
The usual length of time for wearing a cast on a broken ankle would be six weeks.
I would consult your physical therapist about how long you need to see them based upon their examination of you injury.