Originally Posted by
jlp187
...and departure. Visa on your passport must be valid when entering and leaving that foreign destination.
It's all very country specific
If your visa expires while in Brazil, they'll still let you out with a relatively small fine (something like $8 a day), also won't affect your ability to return to Brazil in the future.
In places like Russia your sponsor has to extend your visa and pay significant fines and/or bribes before you'll be allowed to leave... and it can take weeks. In Japan, overstayers are automatically arrested at immigration, detained for 1-3 weeks and then deported with a ten year ban.