Normally you have to take the exam within 30 days of the course end date.
In the SAFe community platform you can see the “extend 2 weeks” button which will be displayed for 30 days after the exam has expired. As soon as you click the button, the two week extension begins. For example, if you require 3 weeks, then wait a week, then press the button. It's important that you don't exceed that grace period as then you would have to pay for another test.