You can operate the business while your application is pending. If it qualifies, it will be retroactively given non-profit status. Hearing back on your status can take a while depending on the amount of applications that are seeking approval.
You can form a nonprofit corporation under state law but you would not be tax exempt until you filed Form 1023 with the IRS which grants exemption from federal income tax. At the state level you would also seek state tax exemption by filing with the state attorney general to get the state exemption as well. The ability to get 501c3 status is not an easy task and you will need the assistance of a not forn profit attorney or possibly CPA to prepare the application.
My answer is not intended to be giving legal advice and this topic can be a complex area where the advice of a licensed attorney in your State should be obtained. Please click "helpful" or "best answer" if my answer added any value or add a "comment" if you have more info for me to help you get a better answer.