Sending the same message indiscriminately to (large numbers of recipients) on the Internet. ~ Google definition
Basically, spam on the DB is posting/doing unnecessary or repetitive things over and over, much to other people annoyance. Spam is often considered to be spam if a person on Chat begins spamming things like 'OPPAN SPAM STYLE!' repetitively like LordMagikarp did for instance, and not stopping if warned. Usually spam reaches around 20+ posts, but repeating the same thing over and over is enough anyway. Spammers are normally kicked off Chat, so you shouldn't have to worry too much about that.
Spam is usually acceptable if nobody is on Chat, so long as it's not insulting or anything inappropriate, since nobody is there to be annoyed by it.