There is a free shuttle between UCSF hospitals. Here is the link for the schedules for the various shuttles: http://campuslifeservices.ucsf.edu/transportation/services/shuttles/routes_timetables. They run often and will be your best mode of transportation between didactics and clinic/OR duties.
There is even a UCSF live shuttle app, which you can find the download for here.
There is also a shuttle to the VA Medical Center, which only runs once per hour from 8 am to 5 pm. The VAMC shuttle picks up near the emergency room at UCSF.
Here’s the link to the official UCSF Map and Transportation website: http://campuslifeservices.ucsf.edu/transportation/.
The public transportation system in San Francisco is called MUNI. There is also BART, which extends as far south as Millbrae and further into the East Bay. It is typically most useful to get from San Francisco <--> Oakland. Should you need/want to travel as far as San Jose, you can take Caltrain as well.
Information on fares can be found on this MUNI link, BART link, and Caltrain link. For overall help with your Bay Area commute, 511.org is a great resource.