Uganda sits on the equator, so temperatures are warm year-round. Altitude matters more than latitude here -- Kampala, at 1,200 meters, enjoys pleasant temperatures in the mid-20s Celsius most of the year. The Rwenzori Mountains and the highlands around Bwindi are noticeably cooler, especially at night.
The country has two dry seasons and two wet seasons. The main dry season runs from December to February, and a shorter one from June to August. The long rains fall from March to May, and shorter rains from September to November. That said, Uganda's weather is not as predictable as it used to be, and you can get rain in any month.
For gorilla trekking in Bwindi, the dry seasons (December-February, June-August) are best. The forest trails are muddy year-round, but they become genuinely treacherous in the wet season. Permits are available all year and the gorillas do not migrate, so wet-season tracking is perfectly possible -- just harder on the legs.
For wildlife and savannah parks like Murchison Falls and Queen Elizabeth, the dry seasons are better. Animals concentrate around water sources and the grass is shorter, making them easier to spot. January and February are peak months.
For white-water rafting at Jinja, the wet season actually offers bigger rapids and more exciting runs. The Nile is raftable year-round.
For trekking the Rwenzoris, the dry seasons are strongly preferred. The mountains get enormous rainfall and the trails are notoriously boggy even in good conditions.
Uganda does not have the extreme high and low seasons of Kenya or Tanzania. You can visit year-round and have a good time. The dry seasons are slightly busier, but Uganda never feels crowded. Gorilla permits are the one thing that can sell out -- book those as far in advance as possible, especially for June-August and December-January.