This really depends on your specific contract and your local employment laws, so there's no one-size-fits-all answer. That said, most employment contracts in the US don't explicitly forbid side work unless there's a non-compete clause or something about conflicts of interest. If your contract is silent on it, you're probably in the clear legally. The key issue employers care about is whether your second job interferes with your main job - like if you're too tired to perform well, or if there's a direct conflict (working for a competitor, for example).
The trickier part is that even if it's not explicitly forbidden, some employers have policies about disclosure that might be buried in an employee handbook or something you signed during onboarding. It's worth digging through whatever paperwork you got when you started to double-check. If there's nothing there, you're in a better position. That said, being upfront about it can sometimes protect you - if they find out later and you never mentioned it, they might feel blindsided and use that as a reason to let you go, even if the side job itself wouldn't have been a problem.
If you're worried, a low-key conversation with HR or your manager ("hey, I picked up some freelance weekend work to handle some personal finances, just want to make sure that's cool") can actually work in your favor. Most reasonable employers don't care what you do on your own time as long as your main job performance doesn't suffer. But laws vary by location, so if you're really concerned, it might be worth a quick consultation with an employment lawyer in your area.