The best time to visit Etosha is a little subjective as you will see animals all year and while some times of year when it is drier you will see more animals near the waterholes at other times when it is wetter the animals are more active and interesting! Broadly speaking though here is a guide of what to expect:

May to October - Namibian winter months (dry)

This is the dry season in Etosha meaning that the grass is low and waterholes are busy with animals so the best time to see lots of animals, the pan is dry and the camps are busy, temperatures are also at the lowest (but still a balmy 26C to 33C degrees) and rain is very unlikely. Also the sun is at a slightly lower angle giving great morning and evening light for photographers.

All accommodation inside and outside Etosha books up fast for this period.

November to April Namibian summer months

The temperature soars up over this period sometimes topping 40C, averages of 30C plus are common so it's going to be hot!
The rains fall over this time transforming Etosha from a dry, brown/white dusty scene into a flourishing landscape of lush vegetation, the benefits are plenty though as the animals are much more active at this time of year so observing their behaviour is more interesting, also birdlife increases this time of year with many seasonal birds arriving from around the world so excellent for bird spotters. If there are good rains then the giant pan fills up with a shallow layer of water creating a haven for waterbirds many of which come to breed over this period.

When would I recommend?

You will have great game viewing all through the year in Etosha so if your travel dates are constrained by school holidays and work go whenever you are able (just make sure you go and experience this wonderful place), if you do have some flexibility on when you travel to Etosha I would say the best times that balance out weather, how busy it is and good game viewing are May, June, October and November.