As Far From the House as Possible
A dry well is a hole dug in the ground near your house where water runoff from the roof can be gathered. It usually has a base of sand and rock, and lets the gathered water filter slowly into the ground. It also can be made of a large container with holes. The further you can put the well away from the house the less likely the filtered water will return to dampen your foundation or basement. A distance of 30 feet would be ideal.
Depends on Terrain
Another key factor in the placement of your dry well is the terrain around your house. There is no sense putting the well 30 feet from the house if you have to put it 2 feet higher than your foundation. If your house is not well raised, then the dry well should be placed near the house but be well submerged.
You must assess the land around your house. If possible, put the well lower than the house and at least 20 feet away. This may require that you catch the water from your gutters in plastic tubing and run it to the well.