The general rule is to avoid driving 7 to 10 days following surgery.  In some cases, this may be longer.  You need to be able to wear your seat belt comfortably, be clear and coherent and be able to perform an emergency stop.