How long before flying on an airline, after I have cataract surgery?

None. Cataract surgery does not prevent you from flying even right after surgery. There are certain retinal surgery where gas is inserted in your eyes that you should not be flying, due to gas expansion with altitude.
No restriction. No flying restrictions. But you need follow up with your doctor and if complications develop in the first week, you want someone you trust to help care for you.
No restriction. As long as your surgeon did not place any gas in your eye (which would be rare with cataract surgery), then there is no restriction on flying.