The frequency of the sound waves produced by a guitar string depends on the length, tension, and thickness of the string. Shorter strings, higher tension strings, and thinner strings produce higher pitched sounds. Conversely, longer strings, lower tension strings, and thicker strings produce lower pitched sounds.
The type of guitar also affects the sound that is produced. For example, an acoustic guitar has a hollow body that amplifies the sound waves produced by the strings. This gives acoustic guitars a rich, resonant sound. On the other hand, an electric guitar has a solid body that does not amplify the sound waves as much. This gives electric guitars a more focused, "electric" sound.