See the Amazon jungle in the region around Leticia before you get on the boat for Iquitos. Once you get on the boat, you can't get off before Iquitos without seriously inconveniencing yourself. There are travel agencies in Leticia/Tabatinga that can setup jungle visits for you, or you can contact one of the jungle lodges in advance and arrange a stay.
The fast boats leave around 4-5 in the morning and take 10 hours to Iquitos. The cost is around $75US. The slow boats take 2-3 days, do not have a regular departure schedule, and cost about 1/3 the price of the fast boat. You buy your own hammock before you board the slow boat, because you'll be sleeping in the open unless you pay extra for a private room.