How to distinguish between walking on a sphere and walking on a torus? Imagine that you're a flatlander walking in your world. How could you be able to distinguish between your world being a sphere versus a torus? I can't see the difference from this point of view.
If you are interested, this question arose while I was watching this video about the shape of space by Jeff Weeks.
 A: I think that the higher rated answers answer the question except that they require a kind of total knowledge and impracticality. 
What if we assume that light travels in the usual manner on the surface, in 'straight' lines?  Then a program of sending out beams from a single, fixed point and measuring the possibly returned beam could yield sufficient information. 
On a sphere the beam will always return and with the same attenuation from 180 degrees from the emitter regardless of the direction chosen. Whereas on a torus there will be a range of values with two minimums. The total flight time required could, I haven't checked, be made arbitrarily large depending on the angle chosen. 
A: Travel a lot and depict a map of the world. Then try give a colour to every state in your map, in order that neighbours have different colours. If you need more than four colours, you are on a torus.
This is just a reformulation of @Fly by Night's solution, since the chromatic number depends on the genus.
In a more deterministic way, on a torus you can embed a $K_5$, i.e. you can find $5$ points $A_1,\ldots A_5$ such that there exist $10$ non-intersecting paths from $A_i$ to $A_j$, on a sphere you cannot.
As an alternative, given two distinct points $A$ and $B$ on the surface, you can draw the locus of equidistant points (with respect to the geodetic distance) from $A$ and $B$. If such a locus has two connected components, you are on a torus.
Another possibility is to "comb" the surface. If you are able to, you are on a torus. And I bet that there is a plethora of opportunities given by the Borsuk-Ulam theorem, in general. For example, on a torus the wind (as a continuous vector field) can blow with a non null intensity in every point, on a sphere it cannot.
Or try to draw many concentric circles. If you are on a torus, sooner or later one of these circles must intersect itself.
And thanks to Giovanni Barbarino, on a toric surface there is always a point with a zero gravity, so there are some issues in building homes nearby.
A: If the world you live in might have any shape homeomorphic to a sphere or a torus, then you cannot prove that it's not a torus without examining all of the surface.  The reason for this that the surface might look almost exactly like a sphere, except for a small handle somewhere that, topologically, makes it a torus:
$\hspace{120px}$
(Image from Wikimedia Commons; created and released into the public domain by Oleg Alexandrov.)
The illustration above shows a sphere with three (fairly large) handles; those handles could be shrunk to an arbitrarily small part of the surface without changing its topological genus.

So, what about if we assume that you've already examined every inch of the surface, and haven't found any small handles?  How could you tell  whether there might be any big handles that you didn't notice simply because you walked straight through them?
One solution would be to get an (infinitely) elastic loop of rope, initially all coiled into a single spot, and start expanding it outwards until it meets itself on the other side of the world.  Then keep pushing the rope further away from the starting point and towards the initial contact point until it the moving rope has covered all of the surface.
If, by doing so, you can shrink the rope back to a single point without ever making it move back over a part of the surface it has already passed before, your surface is a sphere; if you're left with a loop of rope that you cannot get rid of, then you have a torus (or a surface of some higher genus).
A: Assume you are on a perfect sphere.
Then the circumference is the same at every point.
Therefore if you pick a point on the object, then walk in a straight line and measure the distance then pick a new point and direction, and measure that distance.  On a perfect sphere those two distances will be equal.  
Another way would be that as a flat lander you could see the back of yourself directly in front of you as you turn.  The distance to your back should be constant.
A: $$\underline{\textbf{Dancing on a Surface}}$$
It's time to put on your dancing shoes!
Tie a rope to yourself and anchor the other end to the floor. Let another person do the same to themselves with their rope anchored to the floor at a different place.
Now dance, little flatlander. Dance!
Make sure that when your dance is finished you both end up at one of the anchor points (obviously you can't both end up at the same anchor point). Also make sure that you don't do a 'boring dance' by which I mean your ropes should be suitably intertwined that you can't tug on them so that the rope goes straight from you down to the floor.
I hope you're not tired because now you have to...
Dance again!
Do the same dance that you did before - this is important.
If you are dancing on a torus, then if a third person were to try to unravel the ropes so that they were going straight down from your waists to the anchor point, they would never be able to do it. If you are dancing on a sphere however, the third person will always be able to unravel the ropes and so you're done!

This is essentially an application of the fact that the braid group of two strings on the torus is torsion free, but the braid group of two strings on the sphere is isomorphic to $\mathbb{Z}/2\mathbb{Z}$.
Actually, this would work with more than just two people as well - the braid group of $n$ strings on the torus is torsion free for $n\geq 2$ and the braid group of $n$ strings on the sphere has torsion for all $n\geq 2$ (though the order of torsion elements will not always be $2$ and the braid groups of the sphere are not finite for any $n\geq 3$).
We can also use this to differentiate any other closed surface from the sphere.

The braid group $B_n(T_g)$ of $n$ strings on a closed surface of genus $g$ is torsion free if and only if $n\geq 2$ and $g\geq 1$.

A: Hopefully the land will be filled with (two dimensional) trees: take a very long rope and start connecting the trees in order that every tree is the vertex of a triangle. Do that till the whole world is covered with rope triangles. Now start counting the triangles formed with the rope, the rope pieces connecting the trees and the trees you used to form the triangles. Now you can compute
$$\#\mbox{trees}-\#\mbox{pieces of rope}+\#\mbox{triangles}$$
If you get $2$ you have a sphere, if you get $0$ a torus.
If there are no trees you can use some poles :)
A: One way to determine a torus from a sphere would be to try to comb it. If all the wheat on the planet can tilted or brushed such that there is no cowlick then the planet is a torus.
Notice the cowlick, which tori do not have:

No cowlick:

A: Given that we live on a torus and most people think it's a sphere it is probably very hard to tell the difference.

A: Since we're considering planetary ropes, sufficient resources to mark planetary surfaces, and combing entire planetary surfaces, how about something both "parallel" and with an analog in reality...
Put a satellite in orbit around the Flatlander's city (to get out of the acoustic pollution) and either measure the resonant acoustic spectrum of the world or generate a broadband source and measure the resultant ring-down spectra.  Acoustic spectra of toroids and acoustic spectra of spheroids are distinguishable.  For a real-world analog, see the discussion of data derived from COBE, WMAP, and Planck data.  Torus example.  General article.  Experimental limitations:


*

*If the universe is too big, greater detector sensitivity and/or more acoustic power will be needed.

*If the local environment is too noisy, finding a better place for the detector will be required.

*If the global metric is too nonuniform, the spectrum may be too complicated to understand.  This affects intrinsic curvature methods in other answers.  A particularly likely problem will be dispersion of natural world modes.

*Some of the above can be partially relieved by putting up more satellites and engaging in interferometry.

*If a torus, and the geometry is a large body with a miniscule handle, then very high frequencies may be required.  Greater sensitivity and acoustic power may again be needed.  This issue has also been raised in other answers.  If it turns out that acoustic methods cannot resolve a compact potentially toroidal anomaly, then building particle accelerators at the site of the anomaly may be required to get fine enough resolution.  Note that there's no a priori promise that processes inside the world are capable of resolving arbitrary complexities in the geometry of the world, so it may be impossible to resolve a potential anomaly.

*If the geometry of the world is changing faster than the speed of sound, this method has problems.  Of course all the rope/marking/combing solutions are even more impeded...  (One may think to use light, but Flatland is filled with fog.  This is a crucial component of Flatlanders identifying the rank of those they meet.)


Note:  I'm not saying to put something up out of Flatland.  For that method, see my other answer.
A: i found: How to distinguish between surface of a sphere & surface of a torus 
Take a flat circular ring of a diameter less than Min(diameter of sphere, inner diameter of torus) and freely place it once anywhere on the given surface of sphere or torus & check if the entire periphery of ring exactly touches the unknown surface then it is the surface of a sphere otherwise it is the surface of a torus (assuming perfect geometry of sphere & torus). 
A: I'm not a mathematician and in fact I dropped out of school, so please feel free to smack me down if this is wrong, but:
Can't you just start walking in a "straight line", while drawing your path on the ground as you walk.  If you never get back to where you started, you are on a torus.  If you get back to where you started, make a 90 degree turn, and walk again until you get back to where you started again.  If your second path crosses your first line once, you are on a sphere.  If it doesn't cross or it crosses more than once, you are on a torus.  Otherwise you are on a sphere.
EDIT: This assumes that "torus" means "perfectly symmetrical donut", in the general case of torus = sphere+handles, it will not work.
A: "Mr. Sphere, is my world a torus or a sphere?"
A: The challenge here is that something can be topologically a sphere without having the exact geometry of a sphere.  For example, if you are walking on the surface of an hourglass shape, it's still topologically a sphere, but if you thread a rope around the 'neck', it won't pull tight.
Instead, consider a torus as topologically identical to a big sphere with an extra loop on it that "warps" you to elsewhere on the sphere (a bit like a gym ball with a handle).  We systematically search for loops which don't "pull tight", and test them to see if they're just protrusions or the 'warp' bit of a torus.  This comes in two parts:
1: walk in an expanding spiral to search for loops:  Fix one end of a rope to the ground, and walk in a circle, leaving a trail of chalk on the ground.  Every time you complete a circle, give yourself a bit more rope and try again.
If at any point you cross your own rope, then you've found a loop you need to test.  Alternatively, if you end up crossing your own chalk line, then you've found two loops to test (one for each direction on the chalk that you follow back to your home point).
2: test any candidate loops:  For this, you basically attempt to spiral inwards, and see if you meet yourself or get 'warped' to another place on the sphere.  With different-coloured chalk, trace the outside of the loop all the way around.  Then repeatedly trace that edge again but slightly "inside" (that is, away from your home, into the area you haven't walked on yet).
If you end up spiralling yourself into a point, then you've shown that the area enclosed by your loop is topologically flat, and therefore consistent with being on a sphere.  You continue searching for more loops to test, until you have covered the whole surface of your world.
Alternatively, if you encounter any lines in your original chalk colour, then that means the loop you found was wrapped around the 'warp' of a torus.
This method should find every possible loop in your world, so if you test them all and don't find a 'warp', then you must be on a sphere.
A: Get a (two-dimensional) dog and a very long (one-dimensional) leash.  Send your dog out exploring, letting the leash play out.  When the dog returns, try to pull in the leash.  (Meaning, you try to reel in the loop with you and the dog staying put.)  On a sphere, the leash can always be pulled in; on a torus, sometimes it can't be.
(See homotopy.)
A: The Gaussian Curvature is an example of an intrinsic curvature, i.e. it is detectable to the "inhabitants" of the surface. The Gauss-Bonnet Theorem gives a connection between the Gaussian Curvature $K$ and the Euler Characteristic $\chi$. For a smooth manifold $M$ without boundary:
$$\int_M K~\mathrm{d}\mu = 2\pi \chi(M)$$
The Euler Characteristic and the genus of the surface are connected by $\chi(M) = 2-2g$. A sphere has genus zero and so $\chi(S^2) = 2$, while a torus has genus one and so $\chi(T)=0$.
You could, as the ordinance survey people do, choose triangulation points on your surface, measure the Gaussian Curvature at those points and then use this to approximate the above integral. 
A: If you succeed in finding a non-separating loop then you know you are not on a sphere.
A: I would start by assuming a flat 2D surface. Then, survey a sufficiently large right angle. The relation between the three points should show whether the true surface is a torus or a sphere, partly in line with @Fly by Night 's answer.
Over time, one could also measure the tiny fluctuations in the distance and angle between the three points and gain a wealth of gravitational and seismological data about the world as well. 
A: A simple answer. (If you can measure the distance travelled.)
Take a few trips on both surfaces (just go straight till you reach the initial point). If it is a sphere you will be covering the same distance every time, but not on a torus. For this you need to fix a starting point and fix a direction, which the flatlanders are capable of. You need to change the direction of travel, of each trip, by an "odd" angle (not 90 degrees or its multiple). I guess 3 trips on each surface would do.
A: EDIT1:
Constant width spirals orthogonal to geodesics shown on a torus are unbounded. But on a sphere they are bounded between two parallels shown for a hemisphere. Imagine distance between adjacent teeth of a comb with same distance between tiny wheels on an axle. A hairy torus permits combing all along their length, but a hairy sphere combs only along restricted lengths up to the red circle Out of bounds polar caps. 



A: Topologically, two geodesics emanating from the same point on a sphere will intersect in an antipodal point, whereas this is not true on a torus.  So with a friend (and enough time), you can do this.
