You can legally stay in US for the entire I-539 pending time no matter how long as long as you file it before your current H-1 I-94 expires.