There is a TON of misinformation out there about this topic. The good news is that the answer is simple. As soon as you fix an original song to a fixed, tangible medium, you automatically are the owner of its copyright. What this means is that when you come up with a song that is original, and doesn't have any samples of other people's songs in it, all you have to do is record the song, or write down the lyrics and music (you can just write out the chords and melody), and you are the exclusive and sole copyright holder. You now have all the rights that go along with being the copyright owner.
It's important to note however, that if you write with someone else, or with an entire band, you must determine the fractional ownership of the song. Many people split it 50/50 between the person who writes the music and the person who writes the lyrics, but you can divide it any way you like. R.E.M., for example, when they had four band members divided all of their songs four ways (25% each), no matter who wrote what.
Even though you have copyright simply by fixing an original work in a tangible medium, there are some other things you should do to protect this work in case there is a dispute. The best way to protect the work is register your songs with the library of congress. Following this link will take you to the site where you can download the necessary forms: http://www.copyright.gov/.
Additionally, you should submit your work to the performing rights organization (ASCAP, BMI, SESAC) with whom you are affiliated. For more information on performing rights organizations, check out the resources on the Artists House site. Registering with the Library of Congress, and submitting your song(s) to a PRO gives you great security that if someone claims to have written your song, that you will win in the dispute.
This leads me to my next point. You might have heard of people mailing themselves a song. This is called "Poor Man's Copyright," (I used to do this!) and the reason people do it is because it sets a date of creation. In other words, if you write a song and mail it to yourself, as long as you don't open the envelope, you have some form of proof - because of the postmark date - of when you created the song. This way, if someone claims to have written it before you, you can just pull out your unopened envelope and prove your date of creation. Of course, with laser printers being what they are it's certainly possible to forge postmarks, so, the best way to establish the date of creation is by registering with the Library of Congress.