This is a very general question. In my experience, if it's a major surgery, your surgeon will have recommendations about when to stop taking warfarin. I've had some minor things done over the years, and in most cases have stopped taking warfarin for two or three days until my INR dropped below about 1.5 or so. After the procedure, most doctors, and some dentists, want you to take Lovenox (low molecular weight heparin) until your INR returns to within range. In my case, I usually just take my regular dose - in three days, my INR is back in range. The two or three days that it takes to get back into range don't pose much risk (although it may be possible, following a significant surgery, to risk a clot, so Lovenox or heparin (if you're still in the hospital) will probably be administered, just to be certain that your INR is high and to reduce the risk of throwing a clot.
Your surgeon should be well aware of the protocols necessary to get you ready for surgery, and for post-op anticoagulation management.