Slow connection definitely desyncs more. You can help this by using faster connection (duh!), not tabbing out of Elements during PvP (Flash lags heavily when not tabbed in), and if you're playing competitive PvP, there's this etiquette to say "in" before you start playing (so people know it's not a desync from the start).
As for penalties, none as far as i know. PvP1 and PvP2 will still go on with the computer taking over player during desync if it makes the game disconnected. If still connected, then good luck winning against an opponent which can summon Shriekers thrice in a turn, fully heal self, and such.
There are, however, penalty in competitive PvP. Sometimes people can intentionally desync (if he got a bad starting hand, for example) and then asking for rematch. Doing this over and over will cause suspicion, and is counted as cheating. If you desync in the middle of the game, you can ask rematch or give the win to your opponent (in case it's clear your opponent is winning, even when you can make a comeback).
TL;DR: improve connection, don't tab out. No penalty in usual PvP but there are penalties in competitive PvP.