Hello Mounir,
there is no way to know if a user is a student or a teacher. The reason is that every site can have different capabilities for teacher/student. So the only thing that the app knows is if the user can perform certain actions or not. For example, using the WebServices:
core_course_get_user_administration_options
core_course_get_user_navigation_options
mod_forum_can_add_discussion
Kind regards,
Dani