Don't worry about leaving US. Its not necessary at all.
As long as you are in Valid status, there is no time frame, but if you are out of status, file the case before 180 days of being out of status.
Go ahead and file it right away if you fear to return to your country. Don't ever try it, with...