The general rule is that your length of stay will be based on your Form I-20 or Form DS-2019 end date, or four years, whichever is shorter. You will also get a “grace period” of 30 days.
For example, if your I-20 was issued for a two-year program from September 1, 2026 - May 31, 2028, your I-94 will fix your legal stay to May 31, 2028 plus 30 days, or June 30, 2028. That would be your deadline to depart the U.S.
However, if your I-20 was issued for five years, from September 1, 2026 - May 31, 2031, your I-94 will be limited to four years (plus 30 days), ending around June 30, 2030. You would need to contact ISSS in early 2030 to learn more about how to extend your time so that you can complete the remainder of your program.