Undergraduate programs (to get your bachelors degree) are usually 4 years. Masters programs are 1-2 years depending on the school and the subject. Doctoral programs (to get a PhD) say that they are 4-5 years, but can run longer. In the US it is not necessary to get a masters degree before beginning a PhD program. In fact, many people who get masters degrees originally enrolled as PhD students then exit the program at midway through the PhD program (when they've done enough to get a masters degree but not enough for a PhD).