In the US, in math, one starts out after the PhD as either assistant professor, or more commonly now postdoctoral fellow for about 1-3 years.
Then a "tenure track" job hopefully follows as assistant professor. One pursues ones research, practices ones teaching, and after 4-6 years of publishing and establishing a beginning reputation in ones area, one may be promoted to associate professor.
the requirements are roughly the clear sign of emerging excellence in research, and likelihood of, or realization of, national stature as an expert. this is judged based on publications, grants, and letters of reference from known experts.
Then after say 4-6 more years, (but it can be more, or rarely fewer), if one has given evidence of sufficient stature in ones field, preferably on the international level, as evidenced by reviews of publications, letters from expert referees not closely associated with the candidate as friends, one may be promoted to full professor.
the quality of ones teaching should also be excellent, or at least adequate, or that alone can be cause for failure to promote.
The research often tends to receive greater weight, probably since research can bring in grant money. But teaching also matters to students and their parents as well as colleagues, and people also take teaching seriously.
Of course it is less clearly agreed how to evaluate teaching than research. Some people look only at student evaluations, but these can be influenced by factors such as making the course too easy, or giving higher than average, or lower than average, grades. In reading evaluations, one should look for statements that the teacher was "challenging", as well as helpful, but these are not that common. some students comment even on the clothing of professors, or think that a professor is unprepared who does not use notes, when the opposite is often the case.
thus classroom visits and examination of teaching materials by colleagues are also used, as is publication of textbooks, acceptances of such books, and reviews.
tenure is usually granted about the same time as the associate professorship, and should indicate convincing evidence that the candidate is someone who will be a desirable member of the department for life, and in particular who will achieve full professor.
professors who achieve unusual stature in research or as teachers may receive further special chairs or professorships. at a place like harvard, most professors may be chaired ones, while at a state school there may be only one or two if any in a given department.