A Jewish fast may have one or more purposes, including:
Atonement for sins: Fasting is not considered the primary means of acquiring atonement; rather, sincere regret for and rectification of wrongdoing is key. Nevertheless, fasting is conducive to atonement, for it tends to precipitate contrition. Therefore, the Bible requires fasting on Yom Kippur. Because, according to the Hebrew Bible, hardship and calamitous circumstances can occur as a result of sin, fasting is often undertaken by the community or by individuals to achieve atonement and avert catastrophe. Most of the Talmud's Tractate Ta'anit ("Fast[s]") is dedicated to the protocol involved in declaring and observing fast days.
Commemorative mourning: Most communal fast days that are set permanently in the Jewish calendar serve this purpose. These fasts include: Tisha B'Av, the Seventeenth of Tammuz, the Tenth of Tevet, and the Fast of Gedalia. The purpose of a fast of mourning is the demonstration that those fasting are impacted by and distraught over earlier loss. This serves to heighten appreciation of that which was lost.
Commemorative gratitude: Since food and drink are corporeal needs, abstinence from them serves to provide a unique opportunity for focus on the spiritual. Indeed, the Midrash explains that fasting can potentially elevate one to the exalted level of the ministering angels. This dedication is considered appropriate gratitude to God for providing salvation. Additionally, by refraining from such basic physical indulgence, one can more greatly appreciate the dependence of humanity on God, leading to appreciation of God's beneficence in sustaining His creations.
Jewish fast days
A Jewish full fast lasts from sunset to darkness the following night. There are two Jewish full fast days:
The two full fast days carry four restrictions in addition to eating and drinking - one may not wash his body, wear leather shoes, use colognes, oils or perfumes, or have sexual relations. Yom Kippur also has all the restrictions of Shabbat, and Tisha B'Av has restrictions somewhat similar to a mourner sitting shiva.
The Halakha status of the two Jewish full fasts is that they are obligatory.
Minor fasts are observed from dawn to nightfall, without additional restrictions. There are four public minor fasts:
During the four minor fasts a number of changes are made to the liturgy:
The Torah portion for Fast Days (Exodus 32:11-14, 34:1-10), commonly called VaYechal after the first word of the portion, is read during the Shacharit and Mincha services. After the Torah Reading at the Mincha service, Ashkenazi communities read the Haftorah for Fast Days (Isaiah 55:6-56:8), which is commonly called Dirshu after its first word.
During the Shacharit service, Selichot are recited.
Avinu Malkeinu is recited during the Shacharit and Mincha services except at occasions when Tachanun is omitted.
Aneinu is recited during the Mincha service in Ashkenazi communities. It is also inserted by the Chazzan during the Shacharit service. In Sephardic communities it is also recited during the Shacharit service. 
The major and minor fasts that commemorate events having to do with the destruction of the Jerusalem Temple are called the four fasts. They are:
Ninth of Av (Tisha B'Av, full fast)
Fast of Gedalia (Tzom Gedalia, minor fast)
Tenth of Tevet (Asara B'Tevet, minor fast)
Seventeenth of Tammuz (Shiva Asar B'Tammuz, minor fast)
The minor fasts are mentioned in the Bible as fasts in memory of the destruction of the First Temple. However, after the Second Temple was built, these fasts ceased to be observed. The Talmud establishes general rules for observance of the fasts in later periods: if the Temple stands the fasts are not observed and instead have the status of Yom Tov and observed as holidays; if the Jewish people are being persecuted the fasts are observed; if neither of those is the case, then "should they desire, they fast, should they desire not to, they do not fast." Nowadays, the Jewish people are accustomed to observing these fasts, making them obligatory.
Customary fasts are practiced by specific communities, or by especially pious individuals, or by certain classes of individuals.
BaHaB (a Hebrew acronym for Monday, Thursday, Monday) - This is a custom to fast on the first Monday, Thursday and then the following Monday of the Jewish months of Cheshvan and Iyar--shortly following the Sukkot and Passover holidays.
Shovavim Tat, 6 or 8 weeks of repentance when the first 6 or 8 liturgical readings from Exodus are read. Some fast every day (except Shabbat), some once or twice a week, either Monday and Thursday, Thursday only, or Friday only.
A custom exists for a bride and groom to fast on the day of their wedding. It is observed by Ashkenazi and some Sephardi Jews. (This applies both to those who are marrying for the first time and to those who are remarrying.) They fast from daybreak until after the chuppah, eating their first meal during their yichud seclusion at the end of the ceremony. This custom is not recorded in the Talmud, and first appears in Sefer HaRokeach.
Customarily, special prayers called selichot are added in the morning prayer services on many of these days.
Breaking the fast
A break fast is a meal that takes places following a fast. After Yom Kippur, it is viewed as a festive meal. To avoid indigestion, some choose to avoid heavy foods such as meat, observe a custom of eating light dairy foods in moderation.
Other abstentions from food
From the Gemara there is a prohibition against eating before Shacharit, the morning prayers, except for those who are ill or unable to concentrate.
^The Rosh writes that this decision is made on a communal level, and individuals may not deviate. Similarly, the Ritva writes that the decision whether to fast is made by the beit din. Maimonides writes that "all of Israel are accustomed to fast" on these days (Laws of Fasts 5:5). See discussion of these positions. However, R' David Bar-Hayim reads Maimonides to mean that every Jew may personally choose to observe these fasts or not (source).
^Hoffman, Yair. "BaHaB". The Yeshiva World. The Yeshiva World. Retrieved 2017.