You definitely should start thinking about recommendations well before your junior year rolls around. Right from the start of their high school career students should make an effort to get to know teachers. That doesn't mean you have to become a consummate brown-noser! It just means that you should take the opportunity to get to know teachers when you can. Go to an office hour now and then. Seek teachers' help or advice when you have a tough paper or want to discuss problems you had on a test.
By visiting teachers outside of the classroom, the teachers will have a better chance to get to know you academically and socially. Teachers who have such interaction with you can write more impressive recommendations, because it will be apparent to the admissions committee that the teacher actually knows you.
Colleges see tons of recommendations written by teachers who know little about the student beyond his or her grades. To impress admissions committees, make sure you pick a teacher who knows you well, and who you're sure will write a persuasive and enthusiastic endorsement of you and your stellar qualities. Don't be afraid to ask a potential recommenders whether they feel comfortable writing such a recommendation for you.
Don't feel compelled to get a recommendation from a teacher just because he or she gave you your best grade ever. You're looking for a well-written essay from a teacher who knows you well or who teaches courses in a field of particular interest to you. (In other words, if you've written in your personal statement that you're a total science buff, make sure one of your recommendation is from a science teacher!)
Make sure that you give your recommenders plenty of advance notice that you want them to write your recommendations. And, don't forget to write them thank-you notes--they just helped you get into college!