Oh yes, this is always fun.
When you write primarily fantasy, as I do, you can of course create the basic aspects of your world and stop there. I've seen this done well plenty of times, and there's nothing wrong with it. But, maybe because I have a tendency to get over-involved in projects, I love delving further into my world's culture by getting into myths, religion, Creation stories, and more.
Make no mistake, this can be hell. Wait! Is there hell in my fantasy world? Heaven? A God? Many gods? Deities of any kind? Religion? Myth? Help!
Yepp, that's pretty much how the entire process goes. However, I've decided to offer some tips and tricks that I had to learn the hard way in an attempt to make the grueling journey less painful for you.
1. Decide how much you need to know from the outset.
How much you need to decide depends on how much you're willing to revise later. At the beginning of the first draft of my novel, I had little culture and no religion. Now, halfway through my second draft, both are fully developed. I don't mind major revisions because I usually scrap countless chapters anyway, so it wasn't a big deal for me to work things in as they came to me. If you don't like to majorly overhaul your plot, however, you might be better off deciding at least some things before you start. Write things down until you feel comfortable with what you've got, and the begin your novel.
2. Things will come to you if you need them
When you started your story, you had an idea, right? And if you've written anything of significant legnth before, you know that ideas tend to develop as you write them. The story you end up with might not even be in the same genre as the idea you started with, and that's okay. In fact, when you're trying to create history and religion, sometimes it's better just to let things fall into place.
For example, if your idea involves a young man who wants to become a hero and earn the favor of the gods in the hopes they'll reward him by healing his dying sister, then you already know that the gods are going to play a role in your story, if only a background one. You still have to decide smaller things - how many gods are there, are they kind or cruel, involved in human life, how are they worshipped, etc - but the major one's already done. Yepp, you have gods.
If your story, however, is about an older man who wants to write a "Magic will" that leaves all his power to his grandson, but has to struggle against a jealous son who wants all the power and complicated laws that he doesn't understand, then maybe religion isn't important. Or maybe it is; as your story developes, you'll find out whether the main focus is about the old man trying to be fair, or if it's about him trying to give his grandson one last gift before he dies. If you find that the old man's death is involved and becomes central to the plot, then where he goes after death could be important. Just write your story, and elements of religion, myth, or superstition will turn up if you really need them.
3. Know what you're doing before you revise
After you've written the first draft and have what you think could be an inkling of a story - this is when you should nail down some concrete facts, so you know what's important in the second draft. Here's a brief list of things that I think are important. It's not all-encompassing, and if you think of other questions, feel free to add them.
-Do you have gods, creators, spirits, or other deities?
-What kind of power do they have?
-Are they worshipped in any way? How?
-Is there magic in your world?
-What part, if any, does it play in religion? How is related to the gods if you have them?
-Is there an afterlife?
-Heaven? Hell? Different places for good and bad people, or doesn't it matter?
-Is there superstition?
-Do people worship any gods that don't exist?
-Are there multiple religions?
-Is one true?
-How do the different religions treat each other?
You should be able to answer most of these.
Well, that's all I have to offer. Best of luck, if there is any; may the gods be with you, if they exist or care; and may your magic, if you have any, never fail, if that's possible. ;-)