(This definition is based on a definition of Gazal by Dr. Arshad Jamal from the book Aaina-e-Gazal)
Gazal is a collection of 'sher' which follow the rules of 'matla', 'maqta', 'behar', 'qafiya' and 'radeef'. So to know what a Gazal is, it's necessary to know what these terms mean.
Sher (shey-r) - a two line poem. This is a deceptive definition as it does not convey the complexity of thought that can be conveyed in two lines. Each is a "complete" poem in itself. It stands by itself and can be quoted as such, and often is.
Thus, a Gazal is a collection of 'ashaar' (plural of sher) which are complete in themselves and each may deal with topics/ subjects completely unrelated to each other.
Behar (be-huhr) - behar is the metre of the poem. This can loosely thought of as the length of the sher. Both the lines of a sher MUST be of the same 'behar' or 'metre'. Also, all the ashaar of a Gazal MUST be the same behar.
There are 19 different metres that are used. In simple terms, they are divided into three categories - short, medium and long.
Radeef (ra-dee-f) - word or phrase that is repeated at the end of the second line in EVERY sher. The SAME word(s) are repeated.
Qafiya (qaa-fee-yaa) - the rhyming pattern of the word(s) just before the radeef in the second line of a sher. This is a necessary requirment, followed even in the absence of other rules.
Thus, a Gazal is a collection of two-lined poem called sher, having the same behar, ending with the same radeef and having the same qafiya.
Matla (muh-ta-laa) - This is the first sher of a Gazal, and both lines of the sher must end in the radeef. Usually a Gazal has only one matla. If a Gazal has more than one matla, then the second matla is called 'matla-e-saani'.
Maqta (mak-taa) - A shaayar (poet) usually had a pen-name under which he wrote. The pen-name is called 'taKhallus' (takh-ul-lus). The sher in which the taKhallus is included is called the maqta. It is the last sher of the Gazal.
HAT IS A GHAZAL AND HOW TO WRITE IT?
About a ghazal and how to write it, with practical examples and question-answers.
Dr M C Gupta
Guidelines for writing a ghazal/shayari
Difference between Ghazal and Nazm Jagjit Singh Tere Khat
What is the Difference Between a Geet and a Ghazal?
By Tauseefuddin Khan
Defining poetic forms: The ghazal
8.Learn more about beher (meter)
Bah’r: The Backbone of Shaa’iri By : Irfan ‘Abid