What are the sources for the Jewish law or "Halacha"? Is there any priority among these sources? In common practice, when a law is described, is the citation given form the main sources or derived codified books? (Please consider explaining any Jewish/Hebrew terms.)
G-d gave all the laws to Moses, and he passed it on to his students orally until the time of R' Yehudah, who wrote everything down in the mishnah in a concise way (Gitin 60a). We accept everything written there, since it came from G-d Himself. However, by that time, disputes had already risen over things that had to do with logic (which we are expected to apply to other cases when relevant), but not over the tradition itself (Tosafos Yom Tov, Avos 1:4). At around the same time, baraysos (laws not included in the mishnah) were written by contemporaries of R' Yehudah (e.g. Tosefta by R' Chiya). (See also this.)
R' Yehudah had three students, Rav, Shmuel, and R' Yochanan (Introduction to Mishneh Torah). Rav and Shmuel moved to Babylonia, and are therefore major authorities in the Talmud Bavli, while R' Yochanan moved to Israel, and became an authority for the Talmud Yerushalmi (these are both commentaries on the mishnah). However, they didn't actually write these Talmuds, but rather their students did. It turned out that the Yerushalmi was completed before the Bavli. Therefore, we assume that the ones who put everything in the Bavli saw everything in the Yerushalmi, so if the Bavli disagrees, we assume the Bavli disagrees even though it saw the Yerushalmi, so it must have had a good reason for disagreeing. However, if the Yerushalmi is not in doubt and the Bavli is in doubt, we follow the Yerushalmi. This is the explanation that I heard. See also Sdei Chemed Klalei HaPoskim 2:1.
Also, there was the Zohar, written by R' Shimon bar Yochai, but we follow the Bavli over Zohar (Mishnah Brurah 25:42 in the name of the Kneses HaGedolah; see also these sources). We also follow Yerushalmi over Zohar (see this answer). We follow Tosefta over Yerushalmi as well (see Sdei Chemed Klalei HaPoskim 2:5; the Pri Chadash quoted there disagrees). There were other works (e.g. Sifra, Sifri, etc.), but I won't cover them all.
Afterwards, disputes arose in the intent of those Talmuds themselves. There rose up many works of law in order to clarify which opinions in the Talmuds we follow, etc. There were many works (e.g. Bahag), but the Rif's commentary was the first most accepted original work to explain the law. After him rose the Rambam, who most of the time followed the Rif (Migdal Oz in many places). The Rosh also wrote a commentary. These three works were the ones that formed the basis for most of the laws of the Tur (the son of the Rosh).
The two people who wrote the first commentary on the Tur were the Beis Yosef (R' Yosef Karo) and the Darkei Moshe (R' Moshe Isserless), who explained (and sometimes disputed) the decisions of the Tur. But after all their comments, it ended up being that it took a lot of work to find the practical halachah. Therefore, the Beis Yosef wrote the Shulchan Aruch ("set table"), arranged like the order of the Tur, which only contained the practical halachah, its source being the corresponding chapter in the Tur, from which anyone could see how the law developed.
After the Shulchan Aruch, new commentaries came up to explain it and dispute it, so now the most common work to find the halachah is the Shulchan Aruch and its commentaries.
(As a side note, these commentaries which disputed their predecessors didn't dispute the authority of the Talmuds; they either found a case in the Talmuds which they brought as proof against a different case, or made rulings based on logic.)