In general, the position of nicht depends on what you're trying to negate. The logical meaning is often the same so it can also depend on context and emphasis. If nicht is playing the role of an adverb, in other words it's telling you the action described is not happening, then it come near the end of the sentence. For example Ich schlafe nicht. -- "I'm not sleeping." With transitive verbs such as habe it usually comes after the accusative object: "Ich habe das Buch nicht." -- "I don't have the book." Pieces of the verb other than the finite part, including separated prefixes, still normally come last: Ich gebe das Buch nicht zurück. -- "I'm not returning the book." Note that, unlike other adverbs in German, nicht cannot be moved in front of the verb.
But nicht has other functions other than negating the verb. In those cases it normally some before the thing it is negating. For example if negating something with sein it comes before what the subject isn't: Ich bin nicht müde. -- *I'm not tired." Ich bin nicht Karl. -- "I'm not Karl." Ich bin nicht zu Hause. -- "I'm not at home."
In the case Wir haben nicht am Freitag das Examen. the nicht is negating am Freitag, not haben, so it goes before am Freitag and not at at the end. (Related to your other question today, Freitag gets a definite article in German where it wouldn't in English; literally it's "on the Friday" not "on Friday".) Note that the German is hinting at something that gets lost in translation to English; the test might still be another day, all we know is that it won't be Friday. If you wanted to say that the test on Friday was cancelled altogether then you'd probably go with Wir haben das Examen am Freitag nicht. That would mean something more like "Regarding the test on Friday, we're not having it." In uncertain cases either version might work, and you can even have the nicht in front of das Examen in some circumstances: Wir haben am Freitag nicht das Examen, sondern ein Quiz.