Accurate "Okrandian" Klingon was used in most of the feature films, but not in most of the TV episodes. As noted by Ronald D. Moore, how the Klingon language was dealt with was usually left to individual screenwriters, and he personally preferred to just "make it up phonetically".
Of course, one might argue that any Klingon heard in the movies or TV shows is canon, and therefore correct by definition. However, Klingon-speakers tend to follow a different canon, the so-called Okrandian canon, consisting of writings and statements by the language's creator, Marc Okrand, and have taken to referring to the incorrect or nonsensical portrayal of Klingon in the TV series (and a few of the films) as Paramount Hol ("Paramount-ese"), in contrast with tlhIngan Hol ("Klingonese").
In many cases, the Klingon you hear in various episodes is just pure gibberish. This includes, for example, the Klingon hunting song from TNG: Birthright, Part II, or the song sung in Kor's honor in DS9: Once More Unto the Breach, or anything said or sung by the Klingon chef.
In fact, even ENT: Broken Bow, the episode that showed mankind's official first contact with the Klingons and made communicating in Klingon an important plot point (and Hoshi Sato's main motivation for joining the crew), uses dialogue that is completely incomprehensible to Klingon-speakers; perhaps there is some internal structure to this language, but if so, we're unaware of it, and a lot of it does just sound like random barking.
Personally, though, I've never really minded the gibberish, as it's quite easy to explain away: It's a vast empire with a long history, so of course there will be regional and historical languages that are not mutually intelligible with the tlhIngan Hol that we jatlh. Indeed, Marc Okrand uses this explanation quite a lot when retconning what we've seen in the shows. For example, in Klingon for the Galactic Traveler, he describes the opera lines spoken in DS9: Looking for par'Mach in All the Wrong Places as being examples of an ancestral language, or no' Hol, and explains that due to their cultural and historical significance, many Klingons - or at least those with a decent education - will know these lines by heart, just as many English-speakers are familiar with lines such as "Veni, vidi, vici!" or "Sic semper tyrannis!"
Likewise, individual words are usually quite easy to add to the language. Words that have been made up by screenwriters but then been added to the language include bat'leth (betleH - a type of weapon), R'uustai (ruStay - "bonding ritual"), par'Mach (parmaq - "love, romance"), par'Mach'kai (parmaqqay - "romantic partner"), Sto-vo-kor (Suto'vo'qor - where the honored dead go in one Klingon description of the afterlife) and Gre'thor (ghe'tor or ghe''or - where the dishonored dead go).
More frustrating, in my opinion, is when tlhIngan Hol words are used with little regard for tlhIngan Hol grammar, which are more difficult to retcon into the language without making it more ... English-y. One infamous example is the words that Worf speaks to Jeremy Aster during the R'uustai ritual (or ruStay in tlhIngan Hol). He tells him to say SoS jIH batlh SoH, explaining that this means "Mother, I honor you."
The words used can all be found in The Klingon Dictionary, and you'll find that there is a one-to-one correspondence with the English sentence:
SoS = mother (noun)
jIH = I/me/I'm (pronoun) OR *viewscreen** (noun)
batlh = honor (noun) OR honorably (adverb)
SoH = you/you're [singular] (pronoun)
Note that batlh is a noun, rather than a verb, so it's not actually appropriate for the sense of "I honor you". An appropriate alternative would be quvmoH, consisiting of quv (be honored) and the causative verb suffix -moH, so it literally means "cause to be honored".
Things get even worse once you start to consider the grammar of this sentence. In tlhIngan Hol, verbs come with pronominal prefixes, which must agree with the person and number of both the subject and the object of the sentence. In this case, the subject is first-person singular ("I") and the object is second-person singular ("you"), so the appropriate prefix is qa-. Thus, "I honor you" is qaquvmoH (assuming that you are addressing just a single person; if addressing multiple people, it becomes SaquvmoH).
Furthermore, Klingon uses Object-Verb-Subject as its basic word order, so the full sentence becomes SoS SoH qaquvmoH jIH. However, superfluous pronouns are normally omitted, so since the information provided by SoH and jIH is already encoded in the qa- prefix, we end up with SoS qaquvmoH. ("Mother, (I->you)-be_honored-CAUSE.")
So what does SoS jIH batlh SoH mean? Well, it could either be divided into two sentences as SoS jIH. batlh SoH., in which case it means "I am a mother. You are honor.", or it could be treated as a single sentence, in which case it means "You are mother's viewscreen's honor."
A similar example occurs in DS9: The Way of the Warrior, where Drex says to Odo: Lohd Zoss-lee chaw-KU sohk jaTAL? (which, according to the script, means "Does your mother let you talk to men?")
Now, if we fit the pronunciation to tlhIngan Hol words, it seems this breaks down as loD SoSlI' chaw'qu' SoH jatlh? Here they've applied some basic grammar, for example by translating "your mother" as SoSlI', consisting of the noun SoS (mother) and the noun suffix -lI' (your, when addressing a single person, and when the thing "possessed" is a being capable of language). However, the sentence still ends up translating as something like "It ALLOWS your man-mother. You're. It speaks."
A grammatical translation would be
loDvaD bIjatlh 'e' chaw''a' SoSlI'?
("man-BENEFICIARY (you->0)-speak previous_sentence allow-INTERROGATIVE mother-YOUR?")
Other times, the Klingon is correct in writing, but either misapplied or misread. For example, TNG: The Emissary contains two lines in Klingon: nuqneH. qaleghneS. and tlhIngan jIH.
The first of these is spoken to K'Ehleyr by Riker, and is intended to mean "Hello. I am honored to see you." nuqneH is a proper tlhIngan Hol word, and often reported as "the closest thing Klingon has to a word for hello". However, it actually means "What do you want?" and is used accordingly, so the way it is used as a greeting here is strange. The word qaleghneS, on the other hand, can indeed be translated as "I am honored to see you."; it should only be used when addressing somebody who outranks you, which I think you can argue is indeed the case here.
tlhIngan jIH means "I am a Klingon.", as intended. I believe this line was provided by Marc Okrand, but he did not coach the actors, so it ended up being pronounced ti-hin-gon jiii, rather than tling-on jich (or, in IPA: t͡ɬɪŋɑn d͡ʒɪx).
There are certainly exceptions, however. Notably, Marc Okrand provided Klingon dialogue for most of the Star Trek movies in which Klingon is spoken: III, V, VI, XI (deleted scenes) and XII. Furthermore, his language incorporates the lines spoken in Star Trek: The Motion Picture, so those are also correct. You can also hear accurate tlhIngan Hol in a handful of episodes, such as ENT: The Augments and ENT: Affliction.
Star Trek: Discovery apparently has a dialect coach for the Klingons (Rea Nolan), and the few lines that have been made public by (or leaked out of) that production so far have been proper Klingon, so I have high hopes.