It is "修士課程の学生(syuusi-katei-no-gakusei)" for "master's student" and "博士課程の学生(hakusi-katei-no-gakusei)" for "doctoral student".
Usually, we don't distinguish between them, and say "大学院生(daigakuinsei)" or briefly "院生(insei)" which means "graduate student".
When we need to make clear, we just say "マスター" and "ドクター".