@Hopwise addressed the issue of efficiency and mash thickness. But the amount of sparge water will affect your efficiency as well.
The more water you sparge with, the more sugar you'll extract from the mash. The grist will absorb a constant amount of water (around 0.13 gallons per pound of grist). When you add your sparge water and stir, all the sugars are dissolved into the water. If you add a lot of water, the sugars are very dilute. If you add a little water, they're more concentrated. When you drain your mash tun, you're leaving behind jsut the water absorbed by the grain. If the sugars are highly concentrated (i.e. you added a small amount of sparge water), then you're leaving behind more sugar than if the sugars are dilute.
But this doesn't mean that you should add huge quantities of sparge water. The increase in extract is countered by a number of factors. For one, you'll have to boil longer to evaporate all that water you added. Also, you'll have to heat all that extra sparge water. The gains in efficiency are countered by using more energy and spending more time.
I calculate my sparge water volume from the boil time, and evaporation rate. For most beers I boil for 90 minutes. With my setup, this translates to an evaporation loss of around 1.5 gallons. So to get 5.5 gallons into the fermenter I aim for a pre-boil volume of around 7 gallons. You're mileage will, of course, vary.