Every university has different rules for retaking the exam. Usually, most universities can only apply for re-study twice a year, once a semester. If they fail to retake the exam, they can continue to apply next year.
Compared with university exams, students who take the final exams in universities every semester will have a chance to take the exams again at the beginning of next semester for those subjects that fail, which is called "make-up exams". If the make-up exam fails, they must take it again. If the make-up exam fails after the second interview, you may not get the diploma.