As is almost always the case with this kind of question the answer is "it depends". And the follow-up answer is "if it's really important to you, ask a lawyer".

That said, the basic gist of it something roughly like this: Some companies may ask you to sign an agreement when you accept employment, which assigns them rights to anything you create, no matter when or where you create it, or what the subject matter is. For example, when I worked for Lulu.com, the initial IP assignment they asked me to sign was so broad, that if I had written a romance novel in my spare time, they would have had a claim to it.

However, some companies have contracts that are much more reasonable, specifying that they only own stuff you create that is directly related to your line of work, and explicitly excluding stuff you do after hours, on your own equipment, not related to your job there.

Other companies may not ask you to sign any such agreement at all.

So, part 1 of answering this question involves finding out what exactly you signed, if anything.

But... it gets more complicated. State laws may trump your IP agreement with your employer. Some states don't allow employers to make those overly broad "we own your brain 24x7" type claims, so even IF you signed such an agreement, it isn't enforceable.

See what I mean about about talking to a real lawyer (preferably one who is a member of the bar in your local area)?

Another angle is this: Most companies aren't actually flat out evil and don't want to screw you over because they're dicks. I know, this totally violates the left-wing narrative you may have been led to believe, but trust me. Anyway, if they DO have a "we 0wnz your brain" agreement, it is entirely possible that some overzealous lawyer (who may have done it on contract and not even be an employee) wrote the thing (or they downloaded it from some form-paperwork website) and the company barely even knows what is there, and wouldn't actually ask to 0wnz your brain if they thought about it. In those cases, if you simply ask them to change the agreement, there is a good chance they will change it, or just ask you to submit a letter listing the exceptions you want to make, and which they can then sign. Again, by way of example, when I was at Lulu, this is the way they handled it when I pushed back. They just said "OK, just give us a list of everything you are working on on your own time and as long as it isn't directly competitive with us, we'll exempt that". I did, and that was that.

So, it can be complicated, but it isn't always a big deal. The other factor to consider is that if your startup has like NOTHING to do with what your employer does, it's entirely possible that you can start on it, work on it, later quit when the startup gains traction, and nobody will ever be the wiser. But it is a little bit of a risk. If you go that route, I'd advise you to never, ever, ever mention the startup to anybody at your other job and keep a pretty low profile about it. But really, I think you'd be better off spending a few bucks on a laywer (if necessary) and / or do some negotiating with your current employer and get everything squared away nice and proper first. Why take on unnecessary risk?