Instructions on how to get a permit: here.
I used this course: https://www.mycaliforniapermit.com/. Some of the things in the course are not relevant though, such as the parts of a car (just glance through that section quickly). A friend said he used this Driver Ed course: http://www.cal-driver-ed.com/, $10.
The most important thing is to read the handbook: https://www.dmv.ca.gov/web/eng_pdf/dl600.pdf.
Before the real test, make sure to take at least three practice tests: http://driving-tests.org/california/.
I spent about 4-5 hours on the course, another 1-2 hours reading the handbook (much of the stuff in the handbook is already covered by the course but you should read the entire thing anyway), and another 2 hours or so doing practice tests. In total I spent about 7-9 hours.
You should start learning it now so you can get your permit as quickly as possible. It is best to space out the course and reading instead of doing a lot in a short period of time so that you can remember it better.