Something being canon essentially means it's true to the primary1 storyline. A good example of this would be when talking about fanfiction - if a fanfiction has two people dating in it, it would be canon if those two characters are actually dating in the storyline of whatever the fan-made work is based on. It would be non-canon if that's not true.
This isn't just limited to anime or manga; this refers to any fictional story when talking about artwork, literature, discussions, etc produced by fans or non-official sources.
For example, when talking about "ships" between characters, it's canon if they are actually in a relationship. If they aren't and it's just what fans like to speculate about, it's non-canonical. Of course, it's not always this binary; some things are heavily based on real parts of the story but the speculation itself is either false or might be unconfirmed.
1As Pablo pointed out in the comments, I originally had "official" here, but there is an important distinction to make - a company that owns the rights to this media may produce official additional media that may not canon because the author of the original work didn't have any contribution or say in it, but it is still official because it is produced by the company with the copyright.