Most ports have a special desk or office for tourists where you get your passport stamped. Sometimes you can get an official immigration stamp. In other places, you may get a souvenir stamp made just for cruise visitors. It's usually free to get a stamp.