If you entered the United States on a valid nonimmigrant visa and, before reaching the date when your permitted stay runs out, filed an application with U.S. Citizenship and Immigration Services (USCIS) for an extension or a change in your status, you might be on pins and needles waiting for its reply. What happens if you don't hear back from USCIS before your permitted stay under your visa expires? This is not an uncommon situation. USCIS is famous for delays and backlogs of applications. What to do about it is described below.
Perhaps you sent your application at the last minute, and it arrived at USCIS after your permitted stay had expired. Your best option in such a situation is to leave the United States and either visit a U.S. consulate to get a new visa for reentry or, if you haven't yet reached the expiration date on your old visa and multiple entries are allowed on it, simply return.
We're also assuming you've correctly identified your required departure date. It's usually shown on the I-94 Arrival/Departure Record, which is different than the date on the original visa. (The latter date just shows the last day upon which you could have entered the U.S. using that visa.) Although I-94s used to be given out on paper upon entry to the U.S., now they're more commonly logged into a database by Customs and Border Protection (CBP), which you can access.
If you see that the expiration date of your permitted stay in the U.S. is coming, and you're still waiting for an answer from USCIS, it's a good idea to look into what's going on. You can check the status of your application online, at USCIS's Check Case Processing Times page.
If for some reason you're unable to do that, or the answer isn't helpful, get in touch with USCIS via its Contact Center. Perhaps the officer there can give you some news (most likely after you spend a long time going through its voice-automated system and ask for a call-back). It's possible, for example, that USCIS already sent you a decision by mail, but for some reason you didn't receive it.
Once the expiration date of your permitted stay in the U.S. has passed, you have no actual immigration status. If you were working, based on having a visa that permitted U.S. work, you must now stop.
On the other hand, you're not expected to leave the United States. You are allowed to stay until the USCIS decision is made.
Nor are you accruing what's called "unlawful status." This is important, because people who have accrued more than 180 days' unlawful status must, upon leaving the United States, be penalized with a bar to reentry of three years. If you accrue more than one year's unlawful status, the bar becomes ten years.
If your permitted stay under a visa has run out and you're not getting satisfactory answers from USCIS, now would be an excellent time to consult an immigration lawyer. Don't wait until you're at risk of accruing unlawful status or otherwise jeopardizing your right to remain in the United States.