Gutters are installed to collect and control water run off from a roofing system and to control the water until it can be carried far enough away from a building that it does not create a potential for water entry at the roof, walls, or foundation and so runoff dues not result in erosion of soil at the foundation which could result in differential settlement at the foundation.
There are different methods of controlling water as it is discharged from gutter downspouts. The highest quality is a drainage plumbing system which carries water to the storm sewer or as simple as properly sloped soil drainage and gutter downspout splash blocks which prevent water being discharged from the gutter from eroding the soil at the foundation.
In the case of a drain system the gutters downspouts should empty directly into the drain system. The system should be adequately sized to prevent backup and should have some type of clean outs to allow for periodic cleaning.
The most simple method of controlling runoff is through the use of a gutter downspout with an elbow at its discharge configured to direct water away from the foundation. The downspout should empty into a splash block that is graded and configured to direct water away from the foundation.
Getting Them Right
In all cases the configuration of the gutter and downspout is important. The down spout should direct water away from the foundation rather than at or along the foundation and the splash block or drain should carry water far enough away to prevent erosion at the foundation.
Many builders either do not install down spout splash blocks or do not install them correctly. If they do not exist or if they are installed backwards water will be allowed to run back against the foundation and you will often seen deep holes along the sides of the foundation which can result in poor foundation performance over the life of a building.