OP - Nobody can answer this until you supply the air carrier and route.
Strictly enforced, each passenger sits in their ticketed cabin and does not move from that cabin. Whether a swap for the entire flight, part of the flight or a "visit" is permitted, will depend on the route, the carrier and the mood of the relevant cabin crew.