We present a method for measuring the masses of galaxy clusters using the imprint of their gravitational lensing signal on the cosmic microwave background (CMB) temperature anisotropies. The method first reconstructs the projected gravitational potential with a quadratic estimator and then applies a matched filter to extract cluster mass. The approach is well-suited for statistical analyses that bin clusters according to other mass proxies. We find that current experiments, such as Planck, the South Pole Telescope and the Atacama Cosmology Telescope, can practically implement such a statistical methodology, and that future experiments will reach sensitivities sufficient for individual measurements of massive systems. As illustration, we use simulations of Planck observations to demonstrate that it is possible to constrain the mass scale of a set of 62 massive clusters with prior information from X-ray observations, similar to the published Planck ESZ-XMM sample. We examine the effect of the thermal (tSZ) and kinetic (kSZ) Sunyaev-Zeldovich (SZ) signals, finding that the impact of the kSZ remains small in this context. The stronger tSZ signal, however, must be actively removed from the CMB maps by component separation techniques prior to reconstruction of the gravitational potential. Our study of two such methods highlights the importance of broad frequency coverage for this purpose. A companion paper presents application to the Planck data on the ESZ-XMM sample.