The canonical hours are notionally seven in number, with names from a Latin counting system dividing the day into 3-hour sections, although there are overlapping categories as well.
Beginning at dawn, there is Prime, then Terce (3rd or roughly 9am), Sext (6th or noon), None (9th or 3pm), Vespers (sunset), and Compline (night or 9 pm). Overnight (or early in the morning) Lauds/Matins (matins=morning, lauds=praise) occurs. These became fixed in monastic practice, most particularly by the Rule of Benedict of Nursia (d.547), which was promoted by Pope Gregory the Great (d.604), and became standard by the 8th-9th centuries.
An overlapping category is Vigils, or keeping watch during the night beginning at midnight, which John Cassian (early 5th century) divided into 3 periods. Vigils would be kept for certain feasts like Easter and Christmas, as well as some others.
As for Christian precedents, the early writing, Didache 8, recommends that community members recite the "Our Father" 3 times a day. Early fathers Clement of Alexandria, Tertullian, Origen, and Hippolytus recommended praying 7 times a day, perhaps inspired by Psalm 119:164, "Seven times a day I praise you," and also 119:62, "At midnight I rise to praise you." (NABRE)
Shaye J.D. Cohen, "From the Maccabees to the Mishnah" 2nd ed., (2006), has a good section on "Fixed Texts, Times, and Places for Prayer" in early Judaism, on pp.56-60. Daniel 6:11, has Daniel praying 3 times a day toward Jerusalem. During the Exile, prayer came to be seen as a substitute for sacrifice. In the later Diaspora "proseuchai" or prayer-houses were a feature of many communities. Cohen also points out "synagogoi" or meeting-houses, but it's unclear if praying went on in them before the 1st century CE. Rabbis thought people should pray twice a day, morning and afternoon. Some people also added an evening prayer. The Essene communities apparently developed an elaborate liturgical calendar, though there is no continuity between this and later Christian monastic practice, flourishing as it did almost 3 centuries before the first Christian monastic rule of Pachomius in Egypt (early 4th century), arising out of a completely different set of circumstances (thousands of disorganized ascetic hermits who had followed Anthony into the desert).
R.L. Wilken, "The First Thousand Years: A Global History of Christianity" (2012) has a dedicated chapter on monasticism (10), though the canonical hours are not a a topic. (Personal experience of the hours).