Iteration 0 is typically the duration between the initial "Discovery" and "Evolve Phase" of a software project.  As such, there is no formula or a number to determine the iteration 0 duration, which suits all the projects.

image
I use the following check list to decide the duration

1. Duration of the project :  If the duration of the project is small, then one should be cognizant of spending a lot of time on Iteration 0. 
For a 6 months or 1 year project 1 week of  Iteration 0 should be good enough.

2. Pending items : These are the items which could negatively impact starting of Evolve phase.  Based on my coaching experiences on many projects, I have managed to create a checklist of things typically needed to start the actual development.  

Some of them include:
     a. Development and testing environment readiness (licenses, Hardware, etc)
     b. Is Backlog healthy and ready to support one or two future iterations
     c. Do we have the team ready with the right skills
     d. Does the team need any training before they start the coding
     e. Does the team have all necessary tools to start the project
    
If  the team does not have basic things, then there is no meaning in starting the development and waiting in between.

3. Did it exceed > duration  of 1 iteration ?
The iteration duration varies from project to project, and stays between 2 – 4 weeks (max) in most of the good Agile projects.
I always tend to suggest that the Iteration 0 should not exceed duration of one iteration.  In my world, if Iteration 0 needs more time to finish then there are more challenges ahead for this project.