As guitar strings vibrate, the surrounding air starts to vibrate also. This causes sound waves. To make the resulting sound larger, the body of the guitar is designed to start vibrating with the strings. This causes more air to vibrate, creating a larger sound. Those sound waves then travel to our ears.
Most people know that when sound waves enter our ears, they cause our eardrums to vibrate. However, the vibrations also create ripples to form in the fluid that is in our cochlea. The sound wave then causes some hair cells in the cochlea to vibrate, creating an electrical signal that is carried to our brains. When our brains recieve that signal from the auditory nerve, our brains interpet the signal as sound.