Well first of all, you should acknowledge that the system has no acceleration. A pulley with equal masses will have no acceleration. Also, if the masses are equal, you no longer need the subscripts. Just label both of them "m."
You can either do the drawing the free body diagrams or figure out the sum of the forces. Let's start out with the sum of the forces.
The formula for the sum of the forces (if you don't already know) is netForce=mass*acceleration. Since there is no acceleration, mass*acceleration would equal zero since acceleration is zero.
Now let's draw the free body diagrams. For m1 and m2, there are two forces acting upon it: tension of the string "T" and the force of gravity acting upon the mass. Since you know the net force is zero, the tension of the string and the force of gravity on the mass is equal. If you don't already know, force of gravity = mass*gravity. So for both masses, the net force would look like this: Tension - mass*gravity=zero or Tension=mass*gravity (T=mg).