If you are a foreigner working in Peru
: Every time you leave the country on a temporary basis, you need to present  a statement at the border control area indicating you do not have any pending debts with the National Superintendence of Taxing Administration (SUNAT).

More information:http://www.sunat.gob.pe/orientacion/salidaExtranjeros/cRentaEspanol.html

If you are leaving Peru permanently: You should apply for a permanent departure form and surrender your alien identification card no later than 10 days before the departure date. Thus, your departure shall be according to the Law and there will be no problems if someday you wish to return to the country. This proceeding is carried out before the General Migrations

Directorate: www.digemin.gob.pe