Identify the compact surfaces $X$ for which there exist a proper subgroup $G$ of $\pi_1(X)$ such that $G\cong \pi_1(X)$.
Here's another way to rephrase the question. Every subgroup of $\pi_1(M)$ corresponds to a connected cover of $M$. Further, $\pi_1(M)$ characterizes closed surfaces, in the sense that if two closed surfaces have isomorphic fundamental groups, then they are diffeomorphic. (This is something very special to closed surfaces!)
So, another way to recast your question is the following: Which closed surfaces cover themselves in a nontrivial way? (Nontrivial means more than 1-sheeted).
As a further hint: study the Euler Characteristic.