The gopher snake occurs in a wide variety of habitats, from deserts and grasslands to woodlands and open forests. It frequents agricultural regions, especially where there is brushy cover such as fence rows.
Diet varies according to size, with young eating insects, lizards, rodents, and birds and their eggs. Adults can take larger prey, occasionally as large as rabbits.