In this paper, we address the problem of groundwater exploitation by heterogeneous farmers for irrigation purposes. In particular, we study the possible inefficiencies that can arise in this type of common resource problem by considering the dynamic and strategic interactions between groundwater users. To this end, we build a two-player differential game in which two types of farmers (or many farmers grouped into two types, with a representative farmer for each group) display different characteristics related to their agricultural activity. More precisely, they can have different water demand functions, extraction costs, crop productivity, land types and time-preferences. Conditions are studied for the existence and uniqueness of the cooperative and non-cooperative solutions asymptotically converging to a steady state. The model is then applied to the case study of the Western La Mancha aquifer. Effects of the different heterogeneities on the degree of inefficiency of non-cooperative solutions with respect to cooperative solutions are analyzed. Numerical results show that cooperation is always beneficial for the environment and for the agents: It results in higher levels of groundwater stock and total welfare. Moreover, considering heterogeneous time preferences is crucial for reducing the inefficiency of non-cooperation with respect to cooperation, regardless of the other asymmetries between farmers.