Basically, this is related to the theory of Riemann surfaces. Such surfaces arise in complex analysis when one tries to extend the complex plane to make multi-valued functions well-defined.
Take a simpler example first. Consider the function $f(z) = \sqrt{ z}$. This function is not single valued since $f( e^{2\pi i } z ) = - f(z)$. The usual way this is described is to state that this function has a branch cut along a ray passing through the origin. With Riemann surfaces, what we wish to do is to find a manifold that locally looks like the complex plane ${\mathbb C}$, but globally may take some funny shape in such a way that makes $f(z)$ a well-defined function on that surface. For $\sqrt{z}$, one might define the Riemann surface as a 2-sheeted complex plane with the following property - Start at a point on sheet 1, $z$. Then rotate by $2\pi$, i.e. $z \to e^{2\pi i } z$ and instead of reaching the original point (which would be the case if the surface was $\mathbb C$), we reach the corresponding point on sheet 2. A second rotation by $2\pi$ so that $z \to e^{4\pi i} z$ however, does bring us back to the same point. On such a surface, $f(z)$ becomes a totally well-defined function since $z$ and $e^{2\pi i}z$ are distinct points.
At least for this function and more generally for $z^{\frac{1}{n}}$, such Riemann surfaces are beautifully drawn out (for visual help) on Wikipedia
The picture is simple. Whenever a function has branch cuts, we define the Riemann surface so that when you move through the branch cut, you reach a different sheet. When you reach the same branch cut on the second sheet, you come back to the first sheet.
Now, let us describe the analogous procedure for the function
$$
f(z) = \sqrt{ ( z - 1 )(z+1)( z - \tau ) (z+\tau) }
$$
Here is a drawing that hopefully explains the structure. I believe its harder to explain in words.
Let me explain a bit here. The first drawing the branch cut structure of this function on $\mathbb C$. In the second drawing I define a 2-sheeted Riemann surface as shown. The blue and white arrows indicate how one should move past the sheets when going through the branch cuts. In the third drawing I have simply placed the two sheets on top of one another so that the structure is clear. In the very last step, I have added the points at infinity for both the sheets. In doing so, the complex plane compactifies onto the sphere, leaving behind the torus!
This is how a torus can be understood as the Riemann surface corresponding to the function $f(z) = \sqrt{ ( z^2 - 1 )( z^2 - \tau^2 ) } $. Note that the only important thing here is the branch cut structure of the complex function. The function that you have written down also has the same branch cut structure once the point at infinity is included (which we did in describing the torus anyway). This is shown clearly in the last drawing above.