If yes does this apply to historical deities/gods or only to fictional ones?
I believe most ancient gods and goddesses fall under the public domain.
Myths don't have a strict "canon" to them most of the time. They're stories passed down through the ages, and everyone has their own interpretations. For example, the Greeks had their gods, and then the Romans renamed all those gods. Zeus became Jupiter. Hera became Juno.
Should the Greeks sue Rome over copyright infringement?
In the modern day, the Percy Jackson series is probably the first I think of for using mythology. Has anyone sued Rick Riordan for using the name of Zeus?
After all, Disney made the Hercules movie. Wouldn't a major corporation like that love to sue someone for using their characters? I don't see them copyrighting every mention of the Greek gods in media. Why? They don't own the Greek gods. You can't own mythology unless you make it yourself.
However, if I decided to use Hades in my story and made him a man with fiery blue hair, then I might have a problem with Disney. You can't use someone else's interpretation of a god. You have to make your own.
You also can't steal a god in someone else's canon unless it's in the public domain. Eru Iluvatar is a fictional god, yes, but he's in Tolkien's mythos, so you can't use him.
In order to have a copyright, you generally have to actually have created the work in the first place or else hired someone to do so. If you write a story about ancient Greek gods, then you own the copyright to that story (unless you wrote it for hire under contract or employment, in which case copyright ownership can vary somewhat by jurisdiction as well as contract terms, but usually belongs to the entity that hired you.)
If you make up your own gods, then you may also be able to trademark them.
In the case of historical deities, no one owns either a copyright or a trademark for the deity itself and generally copyrights on original writings about them (e.g. original biblical text, Greek or Roman writings about their gods, the Quran, etc.) would have long since expired if they had ever existed in the first place. However, if someone writes a new work about such a deity, the author would generally own copyright to that new work. But they do not own any sort of intellectual property rights with regard to the deity itself. That is, someone else could write a different story about the same deity without any legal problem. They just couldn't copy part or all of the other author's original work without permission.
If they were created for a copyrighted fictional work, then yes, those gods and their names are definitely copyright protected.
This actually happened with the first printing of TSR's D&D reference book Deities and Demigods which contained gods from over a dozen different mythos, three of which were protected by copyright (at the time): Fritz Leiber's "Nehwon mythos", Michael Moorcock's "Melnibonéan mythos", and H. P. Lovecraft's "Cthulhu Mythos".
Although TSR obtained permission for these, prior licensing agreements required them to credit a competitor, Chaosium Games for the latter two of them. Because of this, TSR dropped those from later printings. Because of this, those rare first editions later became quite valuable (I happened to have bought one when it was first released).
Further, TSR later sued another company (Game Designers' Workshop) claiming that they had based one of their mythos on the Shadow Plane mythos in Deities and Demigods.
Note however, that copyrighted material can be used in the U.S. as long as it falls under the limits of "Fair Use", which for practical purposes here would mean non-fictional reference and review-type articles. Using them in your own fiction would usually only be passable in parody and satire (unless you got permission first).
It is possible to get a deity's name recognized as a trademark. For instance, the goddess Nike is registered as a trademark.
For copyright, stories that were written down long ago are in the public domain. Stories that were passed down orally and only recently written down are a more complicated issue. Also, recent stories built off of ancient traditions are protected by copyright. For instance, Marvel's Thor comic books are protected. Where things would get sticky is if someone wrote a new story about Thor that had similarities to Marvel's Thor: if it was determined to be based off of Marvel, then it would be a derivative work, but if it the two were determined to have the public domain source as common origin, then it would be an original work.
Are deity/god names protected by copyright or trademark?
They are not protected by copyright because names simply are not protected by copyright. See for example the US copyright circular 33 (PDF), which says
Examples of names, titles, or short phrases that do not contain a sufficient amount of creativity to support a claim in copyright include
- The title or subtitle of a work, such as a book, a song, or a pictorial, graphic, or sculptural work
- The name of a character
These names may in fact be subject to trademark protection if someone has been using them as a trademark. But trademark protection is widely misunderstood. Trademark protection prevents you from using the name "Nike" to sell athletic gear or to engage in any other line of business where someone is already using the name Nike. It does not prevent you from writing stories about deities named Nike or about Nike-branded sportswear.