The transponder needs to be active when in class A, B, and C airspace, above airspace of class B or C airspace, and within 30 miles of class B airspace and anytime above 10,000 ft. MSL.
Reference(s):
14 CFR 91.215 ATC transponder and altitude reporting equipment and use.