I have an idea to write a story. How can I apply copyright to it after it gets written?
Ideas are cheap. There are two important things to be aware of: (1) you can't copyright an idea and (2) no one's going to steal your idea anyway.
New writers seem to think that they've come up with some great new original idea for a plot or character or setting and everyone who comes in contact with it will want to steal it. The cold hard truth is they haven't and nobody will. What matters is the execution.
Legally speaking, there is a difference between "copyright" and "trademark" that I think you are confusing. Copyrights attach at the moment of creation/publication of a work and need not be applied for, where as a trademark must be applied for. Copyright typically protects intellectual property and ideas and the work must exist in tangible form (so the moment you write it down, boom, it's copyrighted). Trademarks are more of a brand protection. For example, the word "Nike" is not copyright protected and beyond the shoe company, it has meaning (a greek goddess of Victory, hence why a sports apperalle company took the name). The font of the lettering, the distinctive "Swoosh" symbol and the logo of "Just Do It" however are Trademark protected. You cannot slap them onto any shoe and sell them, you have to get permission from Nike to do that and good luck with that.
In the context of a written work, the cover art of a book and the words used in the book are seperately copyrighted to their owners however, the combination of both the words and the cover art are Trademarks. I can sell copies of the book "20,000 Leagues Under The Sea" but I cannot go to my bookstore, buy a copy, copy it cover to cover and sell it because the company that published that particular book holds the Trademark.
Edit: It's also helpful to know which jurisdiction you're in as different nations afford different protections. For example, the U.S. has a very unique "Fair Use" standard of copyright protection that allows for use of copyrighted works by people who don't hold the copyright protection of a work under certain circumstances.