It is a mitzva to thank and praise God for the festivals He gave us; we therefore recite Hallel. However, Hallel is not said on every festival. There are three requirements which must be met for Hallel to be said: 1) the day is referred to as a mo’ed; 2) there is a prohibition of melakha on that day; 3) there were special sacrifices offered then during Temple times. Therefore, Hallel is recited on all seven days of Sukkot – they are all referred to as mo’ed, there is a prohibition of melakha then, and each day involved the sacrifice of a different number of bulls. Similarly, Hallel is recited on Shemini Atzeret, the first day of Pesaḥ, and Shavu’ot.
In contrast, on Ḥol Ha-mo’ed of Pesaḥ and the last day of Pesaḥ, Hallel is not recited. Even though they are referred to as mo’ed and there is a prohibition of melakha then, nevertheless since each day involved the same number of offerings as the first day, there is nothing new on which to recite Hallel (Arakhin 10a-b).
Some suggest an additional reason for the omission of Hallel. The Egyptians drowned on the seventh day of Pesaḥ, which is cause for a little grief. This is reflected in the midrash which records God scolding the angels who wanted to sing His praises then: “My creations are drowning in the sea and you are singing praises?!” True, the Jews of that generation certainly needed to rejoice and to sing God’s praises for their salvation, but there is no mitzva for Jews to say Hallel every year on the seventh day of Pesaḥ. Furthermore, since we do not say Hallel on that Yom Tov, it is not proper to say it on the preceding days of Ḥol Ha-mo’ed, as they are of lesser sanctity. Therefore, the obligation to say Hallel on Pesaḥ is only on the first day (Shibolei Ha-leket based on the Midrash; Beit Yosef, OḤ 490:4; MB ad loc. 7).
Even though there is no mitzva to recite Hallel on the last six days of Pesaḥ or on Rosh Ḥodesh, the custom is to recite it then. However, in order to make it clear that this recitation is a custom and not a law, two paragraphs of Hallel are skipped. (The full Hallel is comprised of chapters 113-118 of Tehilim. On the last six days of Pesaḥ and Rosh Ḥodesh, we skip chapters 115:1-11 and 116:1-11.)
There is a disagreement among the Rishonim as to whether a berakha is recited over Hallel on the last six days of Pesaḥ and Rosh Ḥodesh. According to Rambam and Rashi the answer is no, since a berakha should not be recited before fulfilling a custom. In contrast, Rabbeinu Tam, Rosh, and Ran maintain that a berakha is recited on a custom as important as this one. In practice, Ashkenazim do recite the berakha, even when praying alone. The custom of Sephardim living in Eretz Yisrael is not to recite the berakha, and the custom of most North African communities is that the ḥazan recites the beginning and concluding berakhot (“likro et ha-Hallel” and “yehalelukha”) out loud for everyone in the synagogue, but those praying alone do not recite the berakhot. Everyone should continue the custom of his ancestors.
Hallel is customarily recited after the completion of the Amida of Shaḥarit. One should try to recite it with the congregation. If one comes late to synagogue and arrives when the congregation is reciting Hallel, according to many he should recite Hallel together with them, and then go back to Pesukei De-zimra (MB 422:16). See Peninei Halakha: Zemanim 1:13 for customs concerning the recitation of Hallel.