In this paper, we study the joint pilot assignment and resource allocation for system energy efficiency (SEE) maximization in the multi-user and multi-cell (MU-MC) massive multiinput multi-output (MIMO) network. We explicitly consider the pilot contamination effect during the channel estimation in the SEE maximization problem, which aims to optimize the power allocation, number of activated antennas, and pilot assignment. To tackle the SEE maximization problem, we transform it into a subtractive form, which can be solved more efficiently. In particular, we develop an iterative algorithm to solve the transformed problem where optimization of power allocation and number of antennas is performed then pilot assignment optimization is conducted sequentially in each iteration. To tackle the first subproblem, we employ a successive convex approximation (SCA) technique to attain a solvable convex optimization problem. Moreover, we propose a novel iterative low-complexity algorithm based on the Hungarian method to solve the pilot assignment subproblem. We also describe how the proposed solution approach can be useful to address the sum rate (SR) maximization problem. In addition to the algorithmic developments, we characterize the optimal structure of both SEE and SR maximization problems. Numerical studies are conducted to illustrate the convergence of the proposed algorithms, impacts of different parameters on the SR and SEE, and significant performance gains of the proposed solution compared the conventional design.