Usually 1-2 week
It depends on the nature of the ear infection
(outer versus middle) and how quickly treatment is started.
Some many take only a few days to treat while others take a few weeks. It depends on how acute it is and how the treatment is working.
Seeing a doctor to treat it early can help.