Working out who owns copyright is often the first question in any dispute, and the answer is not always obvious.
The basic rule
The first owner is usually the author, meaning the person who created the work. For a photograph, that is generally the photographer. For text, it is the writer. For software, it is the programmer.
Employees
Where an employee creates a work in the course of their employment, the employer is usually the first owner, unless there is an agreement saying otherwise. Work an employee creates in their own time and outside their job is usually theirs.
Freelancers and agencies
This is where many problems arise. If you pay a freelancer, designer, photographer or agency to create something, they usually own the copyright unless there is a written assignment signed by them that transfers it to you. Paying an invoice is not enough on its own. You may have an implied licence to use the work for the purpose it was commissioned, but that may not let you adapt it, register it as a trademark or stop others using it.
Fixing ownership
If you discover that you don't own work you thought you did, the usual solution is to ask the creator to sign an assignment. Most will, sometimes for a fee. It is far easier to do this before a dispute or a sale than during one.
Moral rights
Creators also have moral rights, such as the right to be identified as the author and the right to object to derogatory treatment of their work. These rights can't be assigned, but they can be waived in writing. Commissioning contracts often deal with them.
Joint authors
Where two or more people create a work together and their contributions can't be separated, they may be joint authors and joint owners. Joint owners usually need each other's consent to license the work. This can matter for bands, writing partnerships and collaborative design projects, and a written agreement at the start avoids later arguments.
Ownership and investment
Investors and buyers often ask whether a business owns the copyright in its key assets, such as its software, website and branding. Gaps in ownership, especially for work done by freelancers or early contractors, can delay a deal. A review and a few assignments before fundraising or a sale can save a lot of time.