Driving will depend on the surgery and the postoperative medication. Generally, you should assume you won’t be driving for at least two weeks after surgery. Once your surgeon clears you to drive, you will ease into it with short trips.
Keep your trips as a passenger short. If you have a long ride home after you are discharged, plan on stopping every half-hour or so to stretch.