The duration of an ear infection depends on the severity of the infection and if it is an outer ear or middle ear infection.
If it is an outer ear infection (known as otits externa or swimmer's ear), you will lilely need the debris, pus and wax in your ear canal suctioned out (usually by an ENT Specialist). Together with antibiotic ear drops, this helps fasten the recovery of the ear infection (typically recovers within 1-2 weeks).
If it is a middle ear infection, it may take 1-2 weeks (if there is no fluid in the middle ear) or up to 2-3 months (if there is fluid in the middle ear) to clear up. If you have received treatment for 3 days without any improvement in symptom, you should see an ENT Specialist for an assessment.
Hope this helps and all the best!