From my experience of car camping in California, it is only legal to sleep in public areas as long as there are no parking regulations or signs prohibiting vehicles from parking overnight. I recommend car camping in campgrounds, but if you can't find one, national forests are a good next option.