You need to have a valid nonimmigrant status at the time of filing an application for a 'change of status'. If you are currently out of status, you will not be able to file for a change of status within the U.S. and will need to apply for a visa stamp at a US consulate. Please be aware that once you are out of status, there are adverse consequences if you are unlawfully present in the U.S. - you should consult an experienced immigration attorney to discuss this further.
Disclaimer: The information provided here is generalized and should not be relied upon as legal advice. This communication does not create an attorney-client relationship.
Once you are out of status you cannot adjust status from within the US. You will have to leave the country and go through consular processing.
You should consult with an immigration attorney now and develop a plan for leaving and reentering the country legally. If you stay out of status for 180 days to 1 year you will be barred from from coming back to the US for three years. If you stay here out of status longer than 1 year you will be barred from coming back to the US for 10 years. There are serious consequences to being in the US out of status so this is not something you should wait to figure out.
You are accruing unlawful presence, and not only do you need to consular process any visa, you also may need a waiver for the unlawful presence if you overstay more than 180 days.
Dhenu Savla, Esq.
This answer does not create an attorney-client relationship and is not meant to be relied upon as legal advice.
If you have less than 180 days unlawful presence, it should be no problem. If you do not depart the U.S. and you do not get a change of status, you will continue to accrue unlawful presence and you will not be in valid H1b status.
The above is intended only as general information, and does not constitute legal advice. You must speak with an attorney to discuss your individual case.