The driest months are May to September, with a secondary dry window around January and February. These are also the best times to trek — the trails are firmer, the rivers are lower and safer to cross, and the upper ridges of the mountains are more often clear.
The wet season runs from October to December, sometimes spilling into March. Trekking is still possible but harder: leeches multiply, the rivers swell, and the upper trails turn to mud. The Alas River rafting season runs through these months precisely because the water is high enough; this is a case where the wet season is the right season.
Whatever month you visit, expect rain at some point. The lowland forest at Bukit Lawang is hot and humid year-round and showers can roll in at any time of day. Pack accordingly: quick-drying clothes, a poncho or rain jacket, dry-bags for valuables, and waterproof footwear that does not blister.