The sources that I found for this were in regards to this method being used to repel flies, and not specifically mosquitos, but at least one source mentioned that most claims of the theoretical effectiveness were based off of the interaction of the light refraction with insects with compound eyes. As mosquitos also have compound eyes, it seems feasible that the method would be just as effective (or ineffective) on mosquitos as the houseflies and biting flies that are more commonly referenced in conjunction with this method.
Most proponents of this theory agree that light refraction is the key:
In theory, refraction can be just as confusing for some species of insect, especially the housefly. It boasts a highly sensitive array of eyes which allow it to see in multiple directions at once.
The insect's head mostly consists of a pair of large complex eyes, each of which is composed of 3,000 to 6,000 simple eyes. These eyes can't move or focus on objects like human eyes, but they provide the fly with a mosaic view of the world around them. Each simple eye provides one small piece of the puzzle, much like the way a screen's pixel delivers one detail of the larger picture.
A housefly bases its sense of direction on the direction sunlight comes from. Some entomologists believe that when these complex, sensitive eyes experience refracted light, the insect becomes confused and flies away.
Does this actually work, though?
According to several sources (the howstuffworks.com article, this gardensalive.com article, and snopes.com), in 2007 a researcher named Mike Stringham ran a 13 week study on the effectiveness of this method at one or two egg farms (the accounts differ on the details of the study, which causes me some concern as to how accurately the study's results are reported).
Fly populations at each location were measured by placing cards that allowed the capture and measure of fly droppings. Some cards were placed in control rooms, others in rooms with bags of water.
The results purportedly showed that there was an actual increase in fly population in the rooms with the water bags.
However, snopes.com labeled this claim as "undetermined", due to the fact thtat Stringham's experiment was conducted in an environment that was "indoors with flourescent and incandescent lighting, a factor which may limit its applicability: it's possible the effects of direct sunlight on the bags may produce different results".
The popular show MythBusters also tested this:
Bags of water hung from the ceiling can repel flies.
This myth is based in the theory that refracted light in water confused flies’ compound eyes.
The Build Team made a rig consisting of three chambers separated by trap doors. The first chamber would hold the flies, the second would hold some rotten meat, and the third would hold both rotten meat and a bag of water. They then released over 5,000 flies from the first chamber and waited to see how many flies would go into each of the other two. After the chambers were sealed off, they let all the flies die and collected the corpses to weigh for comparison. The chambers with and without the water contained 35 and 20 grams of flies, respectively, busting the myth.
I haven't seen the MythBusters episode, but this preview does show a quick scene where Kari Byron appears to be lifting a bag of rotting meat out of the fly enclosure, which is outdoors.
So it seems unlikely that this is effective. However, many of the versions of this claim include mention of a few pennies in the water, so, as this article points out, it doesn't appear to be fully tested.