You can take Step 3 at any time you wish; individual programs may require you to take it at a certain point to advance in the residency. This is different from program to program and is not a function of the state per se.
In addition, California requires that FMGs/IMGs have 2 years of post-graduate medical education before applying for an unrestricted license. It is 2 years in Mass, and 3 in New York. For further information on this see:
http://www.fsmb.org/usmle_eliinitial.html
And for individual state medical licensing board info:
http://www.fsmb.org/usmle_eliinitial.html
in cali, we have interesting additional rules that some may not be aware of.
if you're a us medical school grad, then you have to be licensed by the end of your 24th month of residency training... and step 3 is required to be taken and passed in order to obtain licensure.
if you're a foreign grad, as you stated they want you to complete 2 years of post grad training... and you have to be licensed by the end of your 36th month of residency training. again, step 3 being a requirement for licensure. so, they won't want you to apply for licensure until after 24 months, but you have to do it by your 36th month.
if you do not have your license by that time frame (us med school grad at 24th month, foreign med grad at 36th month), then you cannot continue residency training in the state of california.
given the length/reality of the licensure application process, as a us grad, you'd want step 3 passed by around the 20th month of residency training; and as a foreign grad around the 32nd month of residency training.
if you're in a 5 year residency like general surgery, it's not a big deal. but in something like im, fm, or peds, it can be an issue since in both scenarios (us med grad or foreign med grad), the later you wait, the closer you are to the end of residency and thus closer to graduation and looking for jobs post-residency... and not having a license may be an issue for your prospective employer.