Yes, you are permitted to retake the IB exam for all the 6 academic subjects provided your IB school allows it. If they do, you will be given three chances to write the exam in three different examination sessions. Again, this may vary depending on your school.