a) Hamburg - Kiel
You did not mention the weekday, esp in Hamburg there might be issues with traffic on working days. Generally I would calculate Taxi Steinwerder Hamburg Hbf at 30 min. Regional trains from Hamburg to Kiel run every half hour and need 1.15 hrs, so calculate 2 hrs total. There are some long-distance trains,too, but they are only 10 min quicker and do not run often - just take the next train you can catch. Taxi from Kiel Hbf to Ostuferhafen 30 mins, making it a total of 3 hrs... just a fit, if the ship is on time and you are off the ship quickly.
Recommendations: Prebook taxi. Consider changing at Hamburg Dammtor (not Hbf). All trains leaving Hamburg Hbf for Kiel call at Dammtor too. Does not save time, a bit longer taxi, bit less time on the train. But saves nerves, as Dammtor is a much smaller station and shorter walk from street to platform. Consider Taxi for the full distance. With prebooking roundabout 150 Euro.
b) Kiel - Warnemünde
Taxi Ostuferhafen to Kiel Hbf 30 min. Train to Warnemünde minimum 3,5 hrs, depending on connection, some connections take 4 hrs+. No need to change into taxi at Rostock Hbf, take the train to Warnemünde, as the cruise terminal there is in walking distance from the station. But still, that looks too tight, if youve got only 4 hrs. Even car/taxi will take 4+ hrs, as there is only partly motorway.