As an F-1 or J-1 student, you are given a specific period of time to complete your degree requirements.
For F-1 students, this period of time is reflected in the Program of Study section of your Form I-20, and for J-1 students, this period of time is reflected in Section 3 of your DS-2019. If you are unable to finish your degree requirements by that date, you must apply for a program extension BEFORE your current document expires.
Please be advised that in addition to the Program Extension form (as well as a letter of support from the academic advisor for Graduate students), you are also responsible for showing proof of funding for the additional time you need to extend.