Let's say I book a trip from Bergen to Kirkenes. Do I stay on board the whole time (except for when the ship calls at a port, obviously) or is it possible to leave the ship at one destination and board it at another destination? Will I have to buy seperate tickets or will my cabin still be ready for me (since I booked the trip all the way up to Kirkenes)?
In the north, depending on the season, you can book some excursions like dog sledging and snow mobile where you leave the ship at one port and travel by land to catch it one or two stops later but apart from that people doing a cruise all the way from Bergen to Kirkenes typically stay on the ship. That's certainly the expectation.
Your personal key is scanned every time you leave or enter the ship, I don't know what happens exactly if you just fail to show up but I would at the very least warn the cruise director beforehand. And if you want to catch up with the same ship to find your cabin again, you don't have a lot of time to meander around.
Alternatively, many people (locals and tourists alike) book point-to-point tickets for part of the journey, with or without cabin. You could buy separate tickets and do that, probably taking another ship each time (there is one per day). That would leave time to explore coastal towns and areas more fully or perhaps stay some time on the islands.
The ferry is used as a means of local transport although when i travelled on it a couple of years ago most passengers seemed to be tourists making a cruise for several days. If you get off you are unlikely to get on the same ship unless you travel fairly rapidly up the coast so I do not think you will get the same cabin.
I'm pretty sure that your plan would be possible and your cabin would still be waiting when you board the ship again in the next harbor. Hurtigruten warns explicitly that you will have to get to the next harbor yourself and that this will be quite expensive when you miss the ships departure. And it will depart, with or without you. They regularly have to deal with passengers who miss the departure by accident, so why should they handle people who do it on purpose any different.
But you should keep one thing in mind: on large parts of the coast the ship is the fastest way to travel. I once took the night train from Trondheim to Bodø, boarding the ship there because it was not viable to reach Trondheim by plane before the ship departed. In this case we overtook the ship that had already left in Trondheim on its way to Bodø. But (and that is a big "but" with capital letters) this is the only train route that more or less follows the coast in Norway.
If you really want to go to the next harbor by yourself you will have to look into renting a car one way (and I wouldn't expect to find a rental agency in small harbors) or pay a lot for a taxi. Busses an such will have to go around fjords and stick to their schedule, so I wouldn't count on them either. If you decide to go with a rental car keep in mind that you will have to go around fjords as well, or depend on ferries to shorten the route over a fjord. And don't underestimate the weather, especially in the north, and especially in winter.