Depending on your campaign setting idea, in the early stages you may only need a bare minimum of details about your religion. In cases like these make sure you flesh out any particular deities you need (for example if a character is a Cleric or Paladin describe that god in at least bullet points and note any needed game statistics or mechanics such as the god’s domains) and build up the religion later when it is needed or when you have an intriguing idea. This also gives you an opportunity to see how the players react to your religion’s skeleton and build on what they like and what is important to your evolving setting and story.
But if religion, gods, or a pantheon is a key aspect of your campaign setting idea, you’ll want to work it up in detail early during your fantasy world’s development.
Creating a fantasy religion can be as long and detailed task as you want. After all, tens or hundreds of millions of people participate in the real world’s most popular religions and many of those people are teaching, writing and adding to the religion in different ways.
Religion can provide another venue for conflict and drama in your game world. Detailing your world’s religions to any degree adds that same degree of depth to your world for a more rewarding experience.