Well, early on in production it was realized that there would be only one set of quarters that would have to be redressed when serving for other characters. Part of the redressing was the name plate next to the door.
The plates for Kirk's quarters reads:
The plates for McCoy's quarters reads:
The plates for Rand's quarters reads:
These name plates show up very early (McCoy's is seen in The Man Trap), so it was most likely decided before it started showing up in dialog.
The plates for Kirk's quarters reads:
CAPTAIN
JAMES T. KIRK
3F 121
JAMES T. KIRK
3F 121
The plates for McCoy's quarters reads:
LEONARD McCOY
M. D.
3F 127
M. D.
3F 127
The plates for Rand's quarters reads:
YEOMAN
JANICE RAND
3C 46
JANICE RAND
3C 46
These name plates show up very early (McCoy's is seen in The Man Trap), so it was most likely decided before it started showing up in dialog.