Huayaquillas is on the border of Ecuador and Peru near the coast. It's separated by a dirty river from its Peruvian counterpart Aguas Verdes. It's dirty, noisy and busy. Most travellers only come her because they have to.
The Ecuadorian emigration office is 5 kilometers north of Huayaquillas. If you come from Ecuador ask the bus driver to drop you off here. Buses usually don't wait. But you can take the next one for free From Huayaquillas you can take a taxi to the emigration office.
The emigration procedure is usually quick. On entrance to Ecuador you get a stamp in your passport and an emigration card saying how many days you are allowed to stay, usually 90. Onward tickets are seldom required and if so usually you can talk your way out of it. On exit you get an exit stamp and you have to hand over your emigration card. If you lost your emigration card, but your stamps are in order, you have to fill out a new one.
In Huayaquillas you have to cross the international bridge by foot. Either to catch a mototaxi on the Peruvian side to the emigration office or a taxi or bus on the Ecuadorian side to the emigration office.
The Peruvian emigration office is 2 kilometers south of Augas Verdes. If you come from Peru ask the bus driver to drop you off there. The emigration procedure is usually quick. On entrance to Peru you get a stamp in your passport and a emigration card saying how many days you are allowed to stay. Onward tickets are seldom required. Payment is never required. If the migration officer tries his luck anyway, be persistent but polite. On exit you get an exit stamp and you have to hand over your emigration card.
Several bus companies have international lines between Guayaquil and Tumbes or even more south. They wait at the immigration office. This saves a lot of hassle and is a safer and, in general, a cheaper way of crossing the border.
This border crossing is known for muggings and robberies, be very careful of your personal belongings and safety.