If USCIS denies your application before 240 days have finished, your time limit ends right there and you should leave USA immediately (10-15 days is fine) to avoid accumulating any ‘out of status’ time.
Stay in USA after 240 days of i94 expiry
Your stay in US beyond 240 days will be counted as ‘Unlawful presence’ since you have not received any decision from USCIS.
What can happen with ‘Unlawful presence’?
You can be placed in removal proceedings meaning deportation.
It will be more difficult for you to obtain any future US visa.
It is possible that your H1B visa “stamp” is automatically invalidated.
If you keep staying for more than 180 days, you can be barred for 3 years from coming back, when you actually leave.
If you keep staying for more than 365 days, you can be barred for 10 years from coming back, when you actually leave.