Based on my understanding, as long as you can file for H1 timely within your OPT, you can legally stay in the U.S. but you cannot work untill the approval of H1.