Zamolodchikov periodicity is a property of certain discrete dynamical systems associated with quivers. It has been shown by Keller to hold for quivers obtained as products of two Dynkin diagrams. We prove that the quivers exhibiting Zamolodchikov periodicity are in bijection with pairs of commuting Cartan matrices of finite type. Such pairs were classified by Stembridge in his study of $W$-graphs. The classification includes products of Dynkin diagrams along with four other infinite families, and eight exceptional cases. We provide a proof of Zamolodchikov periodicity for all four remaining infinite families, and verify the exceptional cases using a computer program.