The Giants and left-hander Madison Bumgarner have agreed to a five-year extension through 2017, with options covering the 2018 and 2019 seasons.