For California schools, you need to be in California for a year before you can claim residency. But the residency requirements are pretty strict - not only physical presence, but you have to show that you intend to stay in California (register to vote here, get a CA drivers license, pay taxes, etc.) and be financially independent.
https://students.ucsd.edu/finances/fees/residence/criteria.html
When my sister applied to a state school, she'd been financially independent for more than 5 years and had lived in California since she was about 7 years old, but she still had to fill out a huge questionnaire and provide a lot of documentation before she could claim in-state tuition. California makes you work for in-state tuition.
People I knew who became California residents for lower tuition had to move here, rent an apartment (as opposed to living in a dorm), and not accept financial assistance from their parents at all. They were so busy with school and work that they didn't have time for things like traveling home for holidays.
This is interesting, because it is possible my DD 2 will want to take some time between HS and college either in NY or California to try to get residency. Huge differences in both states for in-state vs. out-of-state tuition.