Although westward expansion had been going on for a while before the discovery of gold, the Gold Rush increased the pace of that expansion.
The Gold Rush led to tens of thousands of people trying to make it to California. This highlighted, among other things, the need for a better way to get to California (other than wagon train or ship). That need helped lead to the construction of the transcontinental railroad. The railroads would become the greatest drivers of westward expansion because they brought people west and allowed the things they produced to be shipped east.
So, the Gold Rush led to the railroads which led to a major boom in westward expansion.
Westward expansion began very early, with the ever pressing need for more land. The more land you controlled, the more food and money you had and thus a larger settlement. After people started reaching California, while new land was always a treasure in and of itself, gold was worth much more than the land it was found on. Many people who were travelling westward were indentured servants just being released from their bonds with wealthy land owners and saw the westward expansion as their own chance for a new future. Finding gold would guarantee a prosperous start and a brand new beginning for many coming to the new world looking for just that, but without the added benefit of having a king's ransom in gold.
The more people who traveled west the more need there was to make travel easy from one coast to another. Railways were built across the country to ferry people seeking their fortunes westward while also helping them to send back any materials they may have collected/created.
In short, without the great need to move many people and many materials west, westward expansion would have been slowed due to the lack of interest. Gold gave a reason for people to look to the West, rather than stay on their own prosperous East coast. It linked the two sides of the country together and did a lot for industry at the time.