It depends on the surgery; most large animal vets don't put cows under general anesthesia (they rely on strong local nerve blocks and cows' typically passive nature to stand there when it doesn't hurt) so the practical limit is about one hour, after which most cows will no longer just stand there. An experienced large animal vet can performing a left displaced abomasum surgery in about 15 minutes, open to close. More involved surgeries like a C-section can take an hour to get the uterus opened, the calf or calves out, the uterus closed back up and the abdominal incision closed.
In referral hospitals or veterinary teaching hospitals, some surgeries on cows can take several hours, but the cow would be under general anesthesia and monitored closely. This would likely only be done on a proven show cow, a very valuable breeding animal or a research animal as the cost can be prohibitive.