The length of time it takes to treat an eye infection will depend on the specific type of infection and the severity of the infection. Some eye infections can be treated relatively quickly with a course of antibiotics, while others may take longer to resolve.