There are a multitude of ways we can approach this. There are a lot of classifications and labels for things that can be reasonably marked as wrong in language. For instance, an error might happen in speech or it could happen in writing. It might happen more often in informal contexts or in formal ones prone to hypercorrection. Some errors appear everywhere.
Heck, some errors are actually intentional, and aim to reduce the perceived formality of the message. The errors discussed here are assumed to be unintentional.
This answer classifies the types of errors on what area of language study they concern.
"phono-", according to LDOCE, is a prefix used for whatever relates to sound. Thus, phonological errors are almost always seen in speech, much less in writing. Notably, sometimes they're intentional, and add humorous effect to what's being told.
"foon speeding" is a classic example of spoonerism, where your mind transposes segments of words or phrases.
Morphosyntactic or Grammatical errors
I can't knows how to correct write this sentence.
Morpho-syntax is just a more formal term for "grammar". This is the type of error we're all familiar with: When either the words aren't formed correctly, or their order in the sentence doesn't sound right.
The sentence above is wrong (ungrammatical) because "correct" belongs to the category of adjectives and it can't directly modify a verb like "write". Also after modal verbs like "can", we should always use a non-inflected basic form of the verb, and "knows" is at the very least non-standard.
Semantic errors (errors of logic or meaning)
The little whale is eating the purple sky.
Sometimes, sentences are semantically erroneous. They don't make sense! Semantics deals with meaning in language. An utterance may be right grammatically, but make no sense at all. And that would mean it's nonsensical, not ungrammatical.
The sentence above suffers from a category mistake. No matter how hard the little whale tries, it won't be able to eat the sky.
A very important part of semantics is choosing words. A lot of mistakes learners (such as I) make are word choice errors that either fall into the semantic, or morphosyntactic category.
Prime examples are "affect" vs. "effect", and "lose" vs. "loose".
A: How does the food taste?
B: I love playing tennis!
Some exchanges contain neither grammatically nor semantically wrong sentences, but in the whole, don't make sense. That's where pragmatics comes into play; study of use of language in social contexts.
When you ask your friend, Alex, "Do you have five bucks?", you're not actually wondering if your friend has five dollars. You're indirectly requesting five dollars from him. That's not what the semantics of the sentence can tell you, but pragmatics. That sentence was used when you're buying a sandwich, and it doesn't make sense to suddenly wonder whether Alex has five dollars or not when you're buying something, unless you want to borrow that money.
Punctuation, the grayer area
I don't understand what's wrong with this sentence,
Another type of error people mistake for grammatical errors is an obvious error in punctuation. Punctuation has always been the grayer area. There is no one universal standard for punctuation, and punctuation marks as common as commas and semicolons are major sources of conflicts and discussions on these matters.
However, like all of the subjective topics discussed everyday everywhere, despite so much gray areas, there are some rules almost everyone and every manual of style agrees with. The sentence above should not end in a comma, but either a period, or an ellipsis, which not everyone agrees what the sign for should be, by the way.
The most common punctuation error, universally accepted to be an error, is plenken. That is, adding an inappropriate space before the punctuation mark, which does not exist in English.
Next time you see a sentence on ELL that quite doesn't sound right, don't immediately comment it's ungrammatical! Here is a list of fun and informative resources if you wanted to read further:
: Speech errors, Wikipedia
: Common Word Choice Errors, University of Wisconsin Colleges
: Colorless Green Ideas Sleep Furiously
: That that is is that that is not is not is that it it is