Many professional pianists and piano teachers have at least a bachelor's degree in piano performance. Most candidates for these degrees start playing at a moderately young age and audition for music schools during their last year of high school. You can get a degree from a regular four-year college -- many of which have outstanding music programs -- or you can apply to a conservatory. Conservatories are much more competitive and focus more narrowly on music.
Some piano teachers have bachelors' or masters' degrees in music education. These programs focus on teaching music in school settings, usually in classrooms. A music education program is advantageous because it trains aspiring teachers in student psychology and methods for working with children. Depending on what program you choose, you may be able to focus your studies more narrowly on piano, or on a certain age group.
Pedagogy means teaching -- so this degree is similar to a music education degree. However, it focuses much more closely on piano. A typical piano pedagogy program will offer courses in piano literature, music history and performance practice, and of course teaching. Most piano pedagogy programs are masters' programs but there are a few bachelors' programs available. Most professors advise students to first get a bachelors' in piano performance.
You don't have to have a degree to teach piano. If you're an outstanding pianist, it's possible to simply set up a studio and start teaching (though you'll be able to command higher rates with a degree). Keep in mind, though, that being a good pianist doesn't make you a good teacher. Read up on different teaching methods and styles. Learn as much as you can about music history and performance practice. Also, it's always good for any piano teacher to continue taking lessons or playing for other piano teachers.