Adults take chiefly mammals and birds while foraging in mammal burrows, on the ground, or in shrubs. Juveniles take young mice and small lizards. Prey is killed by constriction. At high elevations with long cold winters, individuals hibernate, often with other species of snakes, in rodent burrows and in deep rock fissures. Eggs are normally laid below the surface in stable rock talus, in abandoned mammal burrows, and in loose moist soil.
Gopher snakes are common in arid and semi-arid regions.
Standing water is not an important habitat element. Prefer sparse and open grassy stages, less common or absent from denser forested habitat. Gopher snakes may be active on the surface whenever temperatures are favorable. During the cooler periods of spring and fall most activity occurs mid-day, but when summer days are hot most activity is restricted to early morning and late evening hours. Predictable seasonal movements have not been reported for ths species in California.