Do all Class B and Class C towers operate 24/7?
The short answer is no. It's easy to find examples of class C towers that aren't 24/7, by checking in the Chart Supplement. Two examples are KXNA (as mentioned in the comments) which operates 1130-0500Z and KHSV, which operates 1200-0600Z. Note that the airspace changes when the tower is closed: KXNA becomes class G, and KHSV becomes class E.

As for class B, I would also assume that they're 24/7. I checked a few (KATL, KBOS, KSEA) in the Chart Supplement and they are indeed 24/7 but I don't feel like checking them all :-)