Both. I started out when my dad helped me get started writing a choose-your-own-adventure game in Scheme. It was very simple at first, but then I started to learn a little more about Scheme using the R4RS reference in MacGambit, and then reading the Structure and Interpretation of Computer Programs.
From there I started reading several more books, and taught myself a few more languages like Pascal, C, and Java. I finally started taking some computer science classes in high school, though I ended up learning more from the textbook than the teacher in those classes (in my C++ class, I believe my teacher actually had to ask me a few questions occasionally).
When I got to college, I actually did start to learn a bit about programming that I didn't already know, and more about computer science, algorithms, and so on. I would say in terms of programming alone, I have been self-taught about 90% of what I know. For computer science in general, I'm about 50% self-taught.
There are also plenty of things I've learned on the job, from other programmers. I was hired for an internship that involved object-oriented Perl accessing a database, when I'd only ever written some simple Perl scripts before. I spent a couple of days before the job started reading up on SQL, and learned a good deal about writing object-oriented Perl code from the lead developer (most of which I have thankfully forgotten now, other than perl -w
and use Strict