Danilo Gallinari and the Denver Nuggets have agreed to a four-year, $42 million contract extension, according to league sources.