The top programs usually do not accept transfer credits, although sometimes you can skip required core courses and choose electives instead. You will need to research this on a program-by-program basis. If you stay at your master's institution for the PhD, the courses usually will
transfer, and you can go directly to your dissertation work.
For you to understand why PhD programs often don't allow credits to transfer, you need to fully understand the process of earning the degree. The first two years (the ones you want to bypass, I assume) are filled with required and elective courses which ensure that everyone progressing toward the degree has the same core knowledge, more or less. You would work with different faculty members during that time so you can choose your advisor (and vice versa) and your dissertation topic. The first two years usually culminate in general/comprehensive exams, which test your knowledge in required areas and which evaluate a written proposal for your dissertation research. Depending on the program, these exams can be written, oral, or both.
Often, you can ask to be tested on a core knowledge area without having taken the course at that institution. Since some programs have a limit to the number of times a student can fail these exams and still remain in the program, you have to be confident you can pass (even if you don't) the first time around.
The length of time to a PhD varies, both individually and by program and field. It's entirely possible for a student in some fields to start at the beginning and earn a PhD in four years. If you can get some requirements waived so you take only one year of classes, then you might get your PhD in three years; however, you cannot count on it, even with a year's worth of transfer credits. You earn a PhD when you've completed significant research, expressed in a written dissertation, that is approved by both your advisor and the program. You don't decide when you are ready to defend; your advisor does.
I know this is probably more information than you needed or wanted.