You can quite smoking and drinking 2 weeks before having the cataract surgery. After having cataract surgery, you'd better quite smoking and drinking for a longer period. Maybe a month is good for your eyes to recover. We know that smoking and drinking will cause red eyes. Smoking can tint the whites of your eyes and make the eyes look ugly. The eyes are delicate after cataract surgery, so any kind of infection or irritation will be a disaster for your eyes.
The doctor will tell you when you should quite smoking and drinking before a cataract surgery. Usually it is two weeks. Both smoking and drinking are bad for our eyes. Why not try to quite them forever. It will take two to three weeks for the eyes to recover after the surgery. But it depends because different people have different health conditions. Some will recover quicker but some slower. I suggest you to quite smoking and drinking for at least 2 weeks.