The core ruling is that one who eats meat must wait before eating cheese or other dairy, a requirement traced to the Gemara's discussion of waiting between a meat meal and a dairy meal in Chullin 105a:6-7, where Rav Chisda states that one who ate meat is forbidden to eat cheese while one who ate cheese may eat meat immediately, and to the related teaching in Chullin 104b:14 that one must at least wipe or rinse the mouth between the two.
The codifiers fix the waiting period at six hours: Mishneh Torah, Forbidden Foods 9:28 rules that one must wait about six hours, explaining this is because meat lodged between the teeth does not go away with mere wiping, and the Tur (Yoreh De'ah 89) likewise measures the interval as the six hours between a morning and evening meal, while Shulchan Arukh, Yoreh De'ah 89:1 codifies the same six-hour wait, requiring also that any meat residue between the teeth be removed and the mouth rinsed even after six hours have passed.
Kitzur Shulchan Arukh 46:9-11 restates this six-hour requirement plainly, adding that one who chewed meat for a child must also wait, though after the six hours only cleaning and rinsing the mouth is needed.
The Rema's gloss cited within Shulchan Arukh, Yoreh De'ah 89:1 records that some hold six hours is unnecessary and that it suffices to clear the table and recite the after-meal blessing, and notes that the custom in some lands is to wait only one hour after the meat meal, provided the after-meal blessing is recited so that the dairy becomes a new meal; the Arukh HaShulchan (Yoreh De'ah 89:6) traces this dispute to differing readings of the Gemara's requirement of waiting "from one meal to the next," noting Tosafot and the Mordechai read this literally so that reciting the after-meal blessing suffices, while others require a token hour's wait reckoned as one twenty-fourth of a day, but only together with the after-meal blessing.
The Beit Yosef (Yoreh De'ah 89) brings the Rambam's position that the concern over a residue of meat does not apply when poultry is eaten after cheese, since the Gemara's case of poultry and cheese eaten 'in free fashion' is understood as cheese first and poultry after, against the Ramban's view that the leniency applies even to poultry eaten before cheese.
Rav Eliezer Melamed (Peninei Halakhah, Kashrut 26:4) explains the two reasons behind the six-hour wait — Rashi's view that the lingering taste of meat can be felt for up to six hours, and the Rambam's concern that bits of meat may remain stuck between the teeth until that time — and concludes that in practice both concerns are taken into account, so that even one who merely chewed meat for a child, or who ate soft meat, must wait the full six hours.
Rav Eliezer Melamed (Peninei Halakhah, Kashrut 26:5) extends this six-hour wait to a dish merely cooked with meat, such as potatoes or a clear soup cooked with meat, even without eating the meat itself, before dairy foods may be eaten, and Kitzur Shulchan Arukh Yalkut Yosef, Orach Chaim 173:3 likewise records the stringent custom of waiting six hours after a meat-cooked soup even when the meat itself was not eaten, though permitting leniency for the sick.
Kitzur Shulchan Arukh Yalkut Yosef, Orach Chaim 494:21 likewise rules that one must be careful not to eat dairy foods after meat except after six hours have passed, even on Shavuot, rejecting any view that Shavuot permits greater leniency, and records the practice of eating dairy first, then meat after proper cleaning and rinsing.
Against the prevailing six-hour practice, Rav Eliezer Melamed (Peninei Halakhah, Kashrut 26:2) records that some, following a custom among certain German Jews cited from the Rema and the Shakh, wait only one hour between the meat and dairy meals, since that interval alone suffices to mark them as two distinct meals, after which cleaning and rinsing the mouth is not required unless meat residue is known to remain.
Darkhei Teshuvah, Yoreh Deah 89:6 surveys customs of waiting only about three hours found in some communities, reasoning that since in winter that interval would already constitute the time of a new meal, the taste of meat evidently does not linger past three hours either, though he notes that a similarly cited lenient position in the Teshuvos Gan HaMelech is better read as rejecting such leniency than endorsing it; and Darkhei Teshuvah, Yoreh Deah 89:20 reports that the later authorities have overwhelmingly reinforced the six-hour practice as having spread everywhere and that one should not breach this fence, permitting leniency to an hour's wait plus after-meal blessing only for the needs of a person who is somewhat ill.
Darkhei Teshuvah, Yoreh Deah 89:3 extends the stringency further, ruling that since dairy foods are treated as a rabbinic-level restriction after meat, even whey or watery milk products should be avoided for the full six hours, except in cases of illness, and Darkhei Teshuvah, Yoreh Deah 89:5 discusses that where there is doubt whether six hours have actually elapsed, one must be stringent and wait until it is certain the time has passed, since this is considered a matter with an available remedy rather than a mere rabbinic doubt, though some latter-day authorities were lenient based on a double doubt.
On the order of eating dairy before meat rather than the reverse, Mishneh Torah, Forbidden Foods 9:26 rules that one who ate cheese or milk first may eat meat immediately afterward, provided he washes his hands and wipes his mouth, a point also addressed through the Beit Yosef (Yoreh De'ah 89) and reflected in Chiddushei Ketav Sofer, Chullin 104b, which analyzes why the Gemara needed to prove the leniency specifically from the case of cheese followed by meat rather than relying on the simpler statement that meat may not be followed by cheese.
Mishnah Berurah 173:2 notes that, per the custom recorded in Yoreh De'ah 89, one should wash the hands even between a dairy dish and a following meat dish if the hands touched the food, applying this only when the two dishes are of comparable consistency.
Among the modern responsa, Rav Ephraim Greenblatt (Revavos Ephraim 5:513) states that eating dairy immediately after meat or poultry is prohibited, while noting that some communities in Western Europe follow a three-hour wait as against the more common six-hour practice; Rav Gavriel Zinner (Nitei Gavriel, Shavuos, perek 31) holds that the six hours are counted from the time meat is eaten, after which dairy may be eaten even within the same meal, and that a child who has reached the age of training should likewise be taught to wait; and Avnei Yashfeh 5:101 takes up related questions about waiting the full six hours even after merely tasting meat, including for the ill, for pregnant women, and for a caretaker tasting milk to check its sweetness for a baby.
On the reverse direction — how long to wait after dairy before eating meat — Shaarei Halacha uMinhag, Yoreh Deah 11 and Shaarei Halacha uMinhag, Yoreh Deah 9 both record the practice of waiting one hour after milk or butter before eating meat, with the latter questioning the precise wording of 'one hour or more'; Rav Moshe Sternbuch (Teshuvos V'hanhagos 2:390) takes up the specific question of how long one must wait after drinking coffee with milk before eating meat, citing the established ruling that one who ate cheese may eat meat afterward; and Igros Kodesh, letter 7704 questions whether a half-hour custom for waiting after dairy before meat can really be derived from the unrelated halachic measure of a half-hour before prayer, noting that the sources he found for the dairy-to-meat order speak instead of eating immediately or within the same meal, or measure the interval by the time to walk twenty-two amot or by a four-mil digestion period.
Two further sources raise the question of a shortened three-hour wait directly: B'Mareh HaBazak Volume VII 58:3 asks whether there is a basis for waiting only three hours between meat and dairy and whether one who has kept a six-hour practice may switch to three, and B'Mareh HaBazak Volume VII 58:2 likewise addresses the source of the three-hour custom.