We consider a diffusing particle that randomly switches conformational state. Motivated by various scenarios in cell biology, we suppose that (a) the diffusion coefficient depends on the conformational state and/or (b) the particle can only pass through a series of gates in the domain when it is in a particular conformational state. We develop probabilistic methods to analyze this case of diffusion with temporal heterogeneity, and use these methods to calculate the expected residence time in portions of the domain before absorption at a boundary. We find several new phenomena not seen in recent studies of diffusion with spatial heterogeneity, some of which are counterintuitive. In particular, the expected residence times can be non-monotonic functions of (i) the initial distance from the absorbing boundary and (ii) the diffusion coefficients. We focus on one-dimensional intervals, but show how the analysis can be extended to spherically symmetric d-dimensional domains.