I keep thinking of Greeks playing Lyres - there had to be a point where someone added strings and the modern shape...
The guitar originated from the lute. What's called a 'kithara,' (a type of lyra) which when pronounced sounds a bit like 'guitar' is why people and historians get mixed up between the two being related.
The lute and the vihuela had their features combined in the 16th Century. The features that were combined were:
Bass and treble strings were added to give the instrument a good range.
Stradivarius produced some early models of this instrument.
In about the 18th century guitar makers added machine heads the guitars making them easier to tune, and adding struts to the soundboxes of the instruments to increase the sound. Antonio de Torres Jurado is credited with finishing the design and layout of bridge, neck, saddle and body size on the guitar.
George Beauchamp added experimental pickups to a 'frying pan' shaped guitar body in an effort to electronically amplify the sound. This became the first Rickenbacker guitar, and the first produced electric guitar. Inventors kept tinkering with electronics and experimenting with types of pickups on different types of guitars. An example of this is the Gibson ES-150, which is an acoustic guitar with a pickup in the neck.
Fender cemented the popularity of the electric guitar with the original design of the Esquire - later the Broadcaster/Nocaster and finally the Telecaster, which is still one of the most popular guitar designs today. The redesigned Stratocaster introduced a few years later remains equally if not more so popular.