This issue can sometimes fall into a gray area, but the answer is probably yes, your employer can restrict you from moonlighting, whether through its personnel policy or by requiring that you sign a non-compete agreement that limits the type of work you can do for anyone other than your current employer.
Most states do not have laws protecting your right to work for another employer, and in the absence of any legal protection, you are most likely employed at will, meaning you can be terminated at any time for any reason. Even if you were not employed at will, violating your employer's policy would be sufficient just cause grounds for termination or discipline. (However, if you live in a state with a law restricting an employer's ability to fire you for lawful conduct outside of work, that law might offer some protection. For more information on these laws, see our site's page on political activity retaliation.)
If it is essential for you to moonlight for financial reasons, or you are gaining experience which might help you advance within your current company, then you may wish to talk to your supervisor or someone in your company's human resources department to find out the reason behind the company's policy, and to see whether your employer is willing to make an exception to the policy. If they understand that your primary loyalty is to your full-time job, and respect the reasoning behind your need to moonlight, then you will have resolved this issue in a way that doesn't risk your full-time employment. If, however, they say no, then you will have to make a decision about whether you can continue in your current employment, which is always easier to make before you are terminated for violating company policy.
If your company does not have a moonlighting policy, then it may not be a problem for you to have a second job, but to be safe, you might want to consult a supervisor or your company's HR department. Also, you should never conduct any business related to your second job while working for the first employer, which includes phone calls, e-mails, and use of your primary employer's supplies or business contacts.