J S Bach composed two collections of 24 preludes and fugues for the keyboard. Book 1, BWV 846-893, was composed in 1722 and Book 2 was written in 1742. The collections are in fact two separate volumes; the first book was originally entitled Das Woltemperirte Clavier (The Well-Tempered Clavier) and Book 2 was simply entitled 24 Preludes and Fugues. Nowadays, however, it is assumed that one is speaking of both volumes when referring to The Well-Tempered Clavier, and the collection is also often referred to as Bach's 48 Preludes and Fugues.
It's generally assumed that Bach intended the keyboard on which these pieces were to be played would have been equal temperament, making it possible to play pieces in any key and have them sound in tune. This had been around for a couple of centuries before Bach's time but was not in general use.
The two sets of pieces consist of 48 pieces of music each, 24 preludes each with their own accompanying fugues. Bach laid out the preludes and fugues in such a way that their keys follow the order of the 12 tone scale, i.e. starting with the Prelude and Fugue in C major, then the pair in C minor, C sharp major, D major, D minor and so on.
It is obvious when listening through the whole two sets that Bach laid them out very particularly and created them in the order in which they were to be played, if played as a full set. The works move through different moods as they progress and there is a special quality to the B minor pieces which come last in each collection. This appears also in the Two-part and Three-part inventions, which are laid out in exactly the same way as the 48 Preludes and Fugues.
In short, the 48 Preludes and Fugues are not only wonderful pieces of music but are excellent teaching material, both for the composer learning musical form (particularly the Fugue which is explored in depth) and for the student of any keyboard instrument. They are amongst the most important keyboard works of Western classical music and should certainly be included in your listening.