Mechanism of oxidation of a secondary alcohol:
The aldehyde that is formed by oxidation of the alcohol is hydrated and this structure is much more sensitive to oxidation than the aldehyde itself. In methylene chloride, hydration cannot take place and the aldehyde is much more resistant to oxidation.
Figure: Hydration of an aldehyde.
For a secondary alcohol with CrO3 the mechanism of oxidation includes the nucleophilic oxygen reacting with the oxidizing agent to generate charged chromium intermediate. Elimination then takes place where α-proton is lost along with the chromium moiety to generate the carbonyl group. The mechanism can be viewed like an E2 mechanism, the variations being that different bonds are being created and broken. As the mechanism needs α-proton to be removed from the alcoholic carbon, tertiary alcohols cannot be oxidized because they do not consist of such a proton.
Figure: Mechanism of oxidation of a secondary alcohol with CrO3
The mechanism as well describes why an aldehyde product is resistant to further oxidation while methylene chloride is the solvent (that is no OH present to react with the chromium reagent). While aqueous conditions are employed the aldehyde is hydrated and this generates two OH groups that are available to bond to the chromium reagent and result in further oxidation.