It only depends on your employment agreement in the other direction. Work done for hire is
by default owned by your employer under federal law. For salaried employees it doesn't matter if it is done during working hours.
The employment agreement can give up this right for things not related to the company's core business, and I usually insist on that in my agreements. But that is not the default behavior.