We study the relation between molecular gas and star formation in a volume-limited sample of 222 galaxies from the COLD GASS survey, with measurements of the CO(1-0) line from the IRAM 30m telescope. The galaxies are at redshifts 0.025<z<0.05 and have stellar masses in the range 10.0<log(M*/Msun)<11.5. The IRAM measurements are complemented by deep Arecibo HI observations and homogeneous SDSS and GALEX photometry. A reference sample that includes both UV and far-IR data is used to calibrate our estimates of star formation rates from the seven optical/UV bands. The mean molecular gas depletion timescale, tdep(H2), for all the galaxies in our sample is 1 Gyr, however tdep(H2) increases by a factor of 6 from a value of ~0.5 Gyr for galaxies with stellar masses of 10^10 Msun to ~3 Gyr for galaxies with masses of a few times 10^11 Msun. In contrast, the atomic gas depletion timescale remains contant at a value of around 3 Gyr. This implies that in high mass galaxies, molecular and atomic gas depletion timescales are comparable, but in low mass galaxies, molecular gas is being consumed much more quickly than atomic gas. The strongest dependences of tdep(H2) are on the stellar mass of the galaxy (parameterized as log tdep(H2)= (0.36+/-0.07)(log M* - 10.70)+(9.03+/-0.99)), and on the specific star formation rate. A single tdep(H2) versus sSFR relation is able to fit both normal star-forming galaxies in our COLD GASS sample, as well as more extreme starburst galaxies (LIRGs and ULIRGs), which have tdep(H2) < 10^8 yr. Normal galaxies at z=1-2 are displaced with respect to the local galaxy population in the tdep(H2) versus sSFR plane and have molecular gas depletion times that are a factor of 3-5 times longer at a given value of sSFR due to their significantly larger gas fractions.