If you're a painter, writer, musician or another type of artist, inventor or innovator, you may seek to copyright your work. This can prevent others from using it or profiting from it without your permission.
An exception to this is what's called "work made for hire." This is essentially any work that you create as part of your job. That's the case whether you're an employee of a company or an independent contractor who has been hired by a company to do work for them. In that case, any copyright for the work would belong to the company (or individual) that hired you.
One example would be an artist who designs logos and does other artwork for their company. Another would be a writer for a newspaper or magazine. If you create computer programs or web designs and content, your work belongs to your employer.
Some cases aren't this clear. Someone may commission an artist to do a painting, for example. There may not be a specific employer-employee relationship between them. However, a judge may determine that the two had an employment relationship. Another gray area might be if a person creates something outside of work, but uses it as part of their work. If challenged, that likely won't be considered work made for hire.
These days, people increasingly do freelance or contract work for a variety of companies. Further, a product may contain the work of multiple individuals. Whether you are hiring someone to do work for you or you're the one who's being hired to do work for someone, it's wise to clarify who owns the work that is produced. A detailed, well-crafted contract business contract can protect everyone's interests and prevent costly, time-consuming litigation later on.