This is a difficult one to calculate. It depends on temperature of the crude oil going into the tank, the ambient temperature, flow rate or amount of tuburlence in the tank, etc. I had conducted experiments, where tanks were designed for 24 hours retention time, had the inlet short circuited to the outlet in 6 seconds. Are you also adding any emulsifier or de-emulsifier into the crude oil ?
To start with a simple sampling of your crude oil and letting it stand will provide you a guide line to figure out the required retention time.
Alot also depends on the design of the water collection facility, eg: say, a spider web design. etc.
In the experiment conducted, tritium (radioactive water) was injected into the inlet of the pipe and a gieger counter was located on the discharge piping. And by gum, I was sure surprised with the 6 seconds result that I got!