In case by "learn" you mean the time until I started liking it and actively creating projects, learning new things, etc. because it's fun, it took me about 9 months. During those months, I had to learn it mostly on paper at school. At some point, we switched over to Delphi (using the Borland Delphi 6 IDE), which still was quite troublesome.
After those 9 months, I needed some tool for automating something on my computer. I started searching, but suddenly I saw the light! "I can use a programming language and an IDE. It's only something small, so why not just create the program myself?" And there I sat, writing that program and extending it with lots of useless stuff, looking up things on Google and learning programming all day. It was a fascinating experience!