Counterpoint refers to the relationship between two musical voices. Walter Piston, who is an eminent music scholar who has written books on the subject, argues that all music is, to some sense, contrapuntal. When you think about it, he has a definite point. In conventional music, there is melody and harmony. The harmony is not the melody, and the melody is not the harmony. By this token, they are different, and contrapuntal.
However, the generally accepted definition of counterpoint states that contrapuntal music contains at least two voices that are different, but also independent of one another. This is different than music without counterpoint in two important ways:
1. In contrapuntal music, the listener has two, sometimes more melodies to listen to, and often is unable to differentiate between a primary or secondary melody. In non-contrapuntal music, there is melody and harmony, nothing else. This is different than a melody and counter-melody, because in that situation, the melody is clearly dominant and the counter-melody is clearly subordinate.
2. In non-contrapuntal music, the focus is largely on harmonic texture. However, in contrapuntal music, harmony is secondary; the focus is horizontal rather than vertical.
It is important to note that there are about as many different kinds of counterpoint as there are people to invent it. However, there are several important types of counterpoint we will talk about here.
The first of these types is referred to as species counterpoint. The main characteristic of species counterpoint is that there is a melodic line, and a line under it that moves in a direct ratio to the melody line. For example, there is a type of species counterpoint in which for every note of the melody, there is one note in the added voice. In this type of counterpoint, the parts move exactly together, and is commonly referred to as "note-against-note" style. There is another form of species counterpoint in which for every note in the melody, there are four notes in the added line. Note that even though there are many more notes in the added line, there is still a direct ratio. 4:1, or 2:1, or 4:1, or what have you.
Here are two common deviations from standard species counterpoint:
In the first, while there are still a note in the added part per note in the melody line, and thus a 1:1 ratio, the notes do not change simultaneously. When they change at different times, they usually produce a dissonance before the other voice moves or "catches up" to create a consonance.
In the second example, we alternate the ratios, so there are parts where the ratio is 1:1, and others where there is 3:1 or 2:1. However, a ratio is still immediately recognizable.
Another form of counterpoint is known as imitative counterpoint. In this form of counterpoint, the added part has a distinct melodic relationship to the melody line. In the canon, probably the most simple type of counterpoint, the added line is the exact same as the melodic line; however, it is offset rhythmically. This separation could be as short or as long as you want; its completely up to you. The fugue is variant on the canon, but is not completely directly imitative counterpoint. The reason for this is that although the lines are introduced in direct imitation, they are independently developed, and therefore take on a non-imitative form. In indirect imitations, the melodic line can be inverted, where the notes are flipped about a certain axis, usually tonic, retrograde, in which the melodic line is played backwards, or a combination of the two. The melodic line could also be diminished, in which the note values decrease and the melody becomes faster, or augmented, where the note values increase and the melody becomes slower. Furthermore, the melodic line could simply be selectively altered so that while it still resembles the original melody, it is its own entity. All of these variations are forms of imitative counterpoint.
The final main category of counterpoint is free counterpoint, in which the two lines are completely different and unrelated. There's really not that much to say about this, it seems to be pretty self explanatory.
Part of what makes contrapuntal music so difficult to write is because it is very difficult to write two independent melodic lines that fit the same harmonic texture. Therefore, when you decide to write contrapuntally, it is very important that you write harmonically first, and then melodically. This way, you can have a definite framework with which to write all of your melodic ideas.
Other than that, the possibilities are really limited by your imagination. My advice to you would be to do many theoretical exercises in counterpoint. Like any skill, it takes practice. And hey, when Bach tried this, he wrote "The Art of the Fugue" which is considered to be the single greatest example of the fugue ever written.
Like I said, this is a very brief glance of counterpoint. Later, we'll go into greater detail, but this is designed simply to get you thinking about how contrapuntal music works.
Go have fun, and keep practicing!