A typical outpatient surgery only takes a few hours - less than ten, usually. However, a typical inpatient surgery would be something of the same length or even longer. The only real difference between outpatient and inpatient surgeries are whether or not the person has to stay in the hospital overnight or longer. Outpatient surgeries can be done and then the patient goes home the same day. Sometimes these are as simple as getting something taken out of a hole, or can be as complex as removing something. Inpatient surgeries require a hospital stay, and are usually more invasive.
A good rule of thumb is that the surgery takes longer when it’s more complicated. A rather uncomplicated surgery can still take a few hours because of how thorough surgeons are when preparing for surgery.