As I see it, California becomes a state around 1850. Did the Navy see an automatic need to build bases there or did it take a while to create naval bases on the pacific coast?
It is worth noting that even before there was any real American presence on the Pacific Coast that the USN operated in the region. The American whaling fleets and trade ships needed protection, and the British peer groups offered potential for raiding. The last naval engagement of 1812 even took place in he Sunda Straight when the USS Peacock found HMS Nautilus almost 6 months after the Treaty of Ghent was signed.
But to your actual question we need to look at how the USN as a sailing Navy organized itself in the early to mid 1800's. In general there was a focus on running things on the cheap and with as small a foot print as possible. Meaning the main Navy yards that political power, distributed lethality in the face of potential blockade, and access to human resources meant the 4 Navy yards in/around Boston, New York, Philadelphia, and Norfolk and the Washington Navy Yard in DC were essentially it. Like the other navies of the day when there was a need a ship would be outfitted there, and sent on its way, and expected to use funds carried or credit, or prepositioned agents to supply whatever they might need on deployment sometimes with treaties or understandings with the local government wherever they might establish as a favorite port far from home. It was in this pattern that both the East Indies Squadron and the Pacific Squadron managed for the 1820's, 30's, and 40's but came to the fore with the victory in the Mexican American war and come 1849 possession of the modern American Pacific Coast. While The Navy Department was very sensitive to the need to have at least a modest Navy Yard to augment the new commercial industry of shipyards and associated industry. After surveys a site in San Francisco Bay was chosen and in 1853 what would become the Mare Island Navy Shipyard started operations. In 1859 the sidewheel sloop USS Saginaw was the first new built US Navy warship built on the West Coast.
Even so the USN presence was often modest, just some gaggle of steam and sail Frigates, Brigs, and Sloops. It should also be noted that the Pacific Squadron was not responsible for much besides territorial defense and showing the flag. Events like the Sumatran Expeditions or Perry's Squadron to Japan fell under the East Indies Squadron.
And really in the 25 years after the Civil War calling the USN a sad joke is an insult to bad comedy. Maintenance was minimized, hull numbers shrank, and what technological parity or edge with peer forces it had rapidly eroded. For instance in 1873 there was a scare of war between the US and Spain when the Spanish executed some of the crew of the ship Virginius and while a Spanish ironclad was visiting New York the US had no ship in active service that could reliably defeat her.
So through the 1880's and 90's there is a resurgence in Naval spending in the US. Again mostly concentrated on the East Coast, but it is also during this time that new bases would be established on Puget Sound near Bremerton WA, and after the overthrow of the native kingdom the first surveys of Pearl Harbor on Honolulu began. Private shipyards had also continued to develop Union Ironworks in San Francisco for instance delivered several notable vessels to the USN in this time, including a pair of Monitors, the famed cruiser Olympia (Dewey's flagship at Manila Bay), and the Battleship Oregon.
However with tensions rising with Spain it was again the now Asiatic Squadron which was the main focus, with Commodore Dewey having essentially all the modern USN ships then in the Pacific with him to take The Philippines. The Pacific Squadron did provide some support though and the Monitors Monterrey and Monadnock which had quite a passage as a low freeboard vessel in the vast rolling Pacific and another view it was a journey made in company with a supply ship but with more than a few clos calls. The Oregon I mentioned above made another journey, this time from SF, around Cape Horn and South America to join the main fleet off Cuba, she arrived after 2 months a bit battered but ready for action.
In the end it was not until the 1920's really that the Pacific Ocean became the main focus of the Navy. With closer ties to Britain, and the destruction of the German Fleet that left the Imperial Japanese Navy as the one credible threat from a power in geopolitical competition. In the 1910's and 20's new investments would be made on shore establishments, Pearl would start its upgrades to a true fleet anchorage, and another base established at San Diego. While there were other organizational changes that also demonstrated this change. The Navy was now built around the 'United States Fleet' which consisted of the Scouting Force of lighter vessels and older ships too and was home ported in the Atlantic, and the Battle Force of the gun line, more modern escorts, those new fancy aircraft carriers, and some others, and home ported in the Pacific(while every summer they would combine either in the Caribbean or Pacific for Fleet Problem war games). This represented a huge shift of the main striking power of the USN to the Pacific in the mid 20's and it really wouldn't ever leave, though in early 1941 the organizational structure of the Pacific and Atlantic Fleets were restored but the ship numbers remained unchanged.
Might also ask /r/geopolitics