I have applied for NIW program and decided to file my I-485 before my I-140 is approved. However, my spouse who is on F1-OPT visa is still waiting for her H-1B visa to be issued. Her OPT will be expired in one month, and if she doesn't get her H1B visa she has to leave the US. My question is that is it better if we apply separately for i-485 or is there any other option that we can apply for i-485 together considering she might have to leave to leave the country while her i-485 is being processed.
First, she will remain in F1 status for 60 days after she successfully completes her OPT. So if her OPT ends on one month, she remains in status for 3 months. Second, if a Change of Status was filed for her while she was in status, she can remain in the US for as long as the Change of Status is pending, regardless of whether she remains in status or not. So after 3 months, even if her H1b Change of Status is still pending, she goes out of status but she can still stay in the US, indefinitely, as long as the Change of Status is still pending. She does not have to leave.
She can file I-485 for Adjustment of Status at the same time as your I-485 is filed, or any time after your I-485 is filed (as long as it's filed in a month where your category and priority date can file I-485). In your category, which is employment-based, at the time she files I-485, she just has to have not been out of status or illegally working for more than 180 days since her most recent entry. Though I see no reason to delay her I-485 instead of filing it as soon as possible, at the same time as yours.