Maybe every second beginner in learning guitar make that question - how long does it take to learn guitar?
I can only suggest, how much it will take for learning guitar in different levels:
1) Simple chords and clean sound – from 2 months to 6 months
2) Rhytm electric guitar – depends on style, maybe from 3 months to 1 year.
3) Solo guitar – also depends on style, from 6 months to unknown terms. It will also depend on your motivation, and how long you want to learn guitar.
Of course, in learning time is not what you must think about. You must think about your quality, you must think about your soul. So, how long does it take to learn guitar, is not a question that you must think.
And for a good motivation, here’s the video from Youtube, Andy Timmons playing Electric Gypsy: