Copyright protection arises automatically when an "original" work of authorship is "fixed" in a tangible medium of expression.
Registration with the Copyright Office is optional (but you have to register before you file an infringement suit, and registering early will make you eligible to receive attorney's fees and statutory damages in a future lawsuit).
Here's what "original" and "fixed" mean in copyright law:
Originality: A work is original in the copyright sense if it owes its origin to the author and was not copied from some preexisting work.
Fixation: A work is "fixed" when it is made "sufficiently permanent or stable to permit it to be perceived, reproduced, or otherwise communicated for a period of more than transitory duration." Even copying a computer program into RAM has been found to be of sufficient duration for it to be "fixed" (although some scholars and lawyers disagree with this conclusion).
Neither the "originality" requirement nor the "fixation" requirement is stringent. An author can "fix" words, for example, by writing them down, typing them on an old-fashioned typewriter, dictating them into a tape recorder, or entering them into a computer. A work can be original without being novel or unique.
Example: Betsy's book How to Lose Weight is original in the copyright sense so long as Betsy did not create her book by copying existing material - even if it's the millionth book to be written on the subject of weight loss.
Only minimal creativity is required to meet the originality requirement. No artistic merit or beauty is required.
A work can incorporate preexisting material and still be original. When preexisting material is incorporated into a new work, the copyright on the new work covers only the original material contributed by the author.