In microwave oven, the dimension of the chamber is determined according to 2.45 GHz frequency (or 12.2 cm wavelength). The chamber is made of metal and it should reflect all microwaves. Why does this reflection depend on cavity dimension as well as the wavelength of a wave? I have also read about Faraday cages, in which it blocks electromagnetic waves. Is there any condition that Faraday cage works according to its dimension and wavelength of incident wave as well?
A Faraday cage blocks radiation, but it is not necessarily a resonator cavity like the microwave chamber.
A microwave oven chamber is designed to be a resonator for certain frequencies and not all. The dimensions of the cavity does, as you say, define the resonating frequency of the chamber. The microwave inside such a cavity needs to be supported by the chamber in the way that they can resonate in the cavity if they can form standing waves. Only multiples of the chamber dimension in frequency can be supported and in this way the resonator chamber confines certain wavelengths.
Other wavelengths may very well be reflected inside the cavity, but they are not necessarily supported resonating modes, and thus they are low in power compared to the oscillating microwaves.
And the other way around, the frequencies in there are mainly the frequencies emitted by the magnetron. The mesh covering the window through which we can observe our food can be viewed as a low-pass filter, letting both in and out shorter wavelengths. Thus these high frequency waves can not resonate in the chamber.
I may have lost my track on the way here but i hope it makes sense for you.
It makes perfect sense if you think about it in these terms: A microwave cavity is the microwave analog of a resonant circuit consisting of a capacitor and an inductor. This is because the cavity possesses significant capacitance and inductance at microwave frequencies- and the microwave energy then "sloshes" back and forth inside the cavity, and the energy gets alternatively stored as a magnetic field driven by current flow, then as an electric field driven by a charge distribution, then as a magnetic field, etc., etc.