Uganda can ultimately be visited year round, but the best times are from December to March or from June to September.
The wettest months of the year are April and May, though Uganda also receives a reasonable of rain in October and November.
It can rain at any time in the forested regions where gorilla and chimp tracking take place, and these activities are available all year round. Game viewing will certainly be best outside of the peak rainy periods and towards the end of the dry seasons (i.e. February/ March and August/ September), and whilst birding will be superb all year round, migrant species are more likely to be encountered from October through to March.