Tunja is cold year-round — sitting at 2,820 metres, temperatures average around 12–14°C and can drop well below that at night. Bring layers regardless of when you visit. The altitude also catches some visitors off guard after the lower elevation of Bogotá; give yourself time to acclimatise.
The dry seasons (roughly December–March and June–August) are the most reliable for clear weather. The rest of the year brings afternoon rain, which is fine for exploring the colonial interior spaces but can make wandering the streets less pleasant.
The city fills up during the Battle of Boyacá anniversary (7 August) — a national holiday marked with parades and official ceremonies at Tunja and the nearby Puente de Boyacá bridge. It's an interesting time to visit if you want to see the city in full patriotic mode, though accommodation books up.