Please only block when necessary, and only use them as a last resort. If applying a block becomes necessary, here are some general guidelines. Do note that these guidelines are not set in stone and some wikis may wish to handle blocking slightly differently. It is definitely preferable to first assume good faith and then exercise caution and restraint.
If a user is creating nuisance vandalism, inserting random words or phrases, using unnecessarily offensive terms, etc., the first step should be reverting the edit, followed by a warning on their talk page. If the user persists in their behavior, applying a 1 day block is appropriate for a first offense. If they come back after the block has expired and continue, progressively longer bans can be applied, but in every instance a warning should be given on their talk page. This is true for both registered and un-registered users.
Violation of Wiki policy
If a user is making edits that violate any written policy of the wiki, including copyright violations, the edits should be reverted and a warning posted on the user's talk page, explaining the violation (including a link to the specific policy). If the behavior continues, a one day block is appropriate. After the initial block has expired, if the behavior continues, progressively longer blocks are appropriate, with a reminder warning on the user's talk page.
If a user is creating unnecessary disruption with their edits, or engaging in behavior that is otherwise disruptive (personal attacks, intentional addition of misleading, or erroneous information, continuing to argue after consensus has been reached, etc.) the first step should be engaging with them on their talk page. If the behavior continues a 1-3 day block is appropriate. As with other types of blocks, progressively longer blocks are appropriate if the behavior continues after the expiration of the initial block.
If edits get past the abuse filters that reference external websites, or things clearly unrelated to the game, and are clearly the work of spambots, globally block them for a few days and let your wiki manager know so that they can update the local or global abuse filters as appropriate. Spambot IPs tend to change quite frequently, so blocks are minimally effective.