I'm talking about the 6 string acoustic guitar, not necessarily the dreadnought shape because I know that was invented in the early 1900s by Martin. But when did an instrument that you could look at and say, "that's a guitar" come around? And what was its predecessor?
This is an excellent question, and kind of depends on how you define "guitar."
If you're just looking for the earliest time you could go back in time and look at an instrument and think "Hey, that looks like a guitar," the earliest documented example is about 1200 BC, coming from a Hittieite Rock Carving, so we're getting biblical up in here.
However, if you want similar to "as we know it," your best bet is probably Medieval Spain. They were definitely in use there by the 1200s, and by the Baroque period of classical music (1500s-1600s...Think Pachelbel's Canon, Handel's Messiah and Vivaldi's Four seasons for stylistic reference) they were occasionally used in compositions in Western Europe.
When we get into the modern guitar with 6 string tuning et. al, the earliest example is again Spain, with an instrument called the Vihulea, that eventually came to be known as the guitar. (I apologize for linking to Wikipedia, but I'm on my phone and that's the best I can do right now).
However, Modern guitar tuning (EADGBE) came from an instrument called the Lute, which was in use from the Ancient Greeks through the Renaissance and on.
So in summary, if you want something that looked enough like a guitar that Bill and Ted could meet up with a player of the instrument and say "You play too? Excellent, Dude!," we're looking at Biblical Times. Similar instruments, including the lute continued to be played and written for well into the middle ages.
If you want something tuned like a guitar, we're most likely looking at the lute, which was used by the Ancient Greeks, and they had developed a long-necked (so guitar-esque looking) by 300 BC.
The 6 stringed version (which is what is commonly used today and I would consider to be the earliest "as we know it") came from Spain in the 14 or 1500s.
EDIT Meant BC, not BS.