Some broken ankles, where the bones stay in line and all the ligaments are intact, are stable and will heal without surgery. They will need a boot, but the bones can heal well on their own.
Other times, the bone pieces shift out of place, or the whole ankle is unstable and needs to be stabilized surgically with plates or screws. The name for that surgery is open reduction and internal fixation. It means the bones are opened and exposed and put back in line, then held in a way that allows the bone to heal. The bones can be held with a plate and screws, or with a thin rod passed down the bone through a smaller cut.
First, the outer bone will be fixed in length and rotation to re-establish the width of the ankle joint. Then the connection between the two bones in the lower leg is examined and fixed if needed. Next, the inner side of the ankle will be fixed. Images will be taken during the surgery and at the end to make sure the bones are lined up well.
How long the surgery takes says little about how long the recovery will take. The bones heal on their own timetable, and then strength and balance get rebuilt.
Surgery here is about restoring the joint's alignment. Even slightly out-of-line healing leads to uneven wear and cartilage damage down the road, trading a fixable break for long-running ankle pain. Few injuries reward delay less than a displaced fracture.