In the original series, the Enterprise has a five-year mission into "uncharted space". Once they're out beyond the charts, how exactly do Kirk and the other officers on the Enterprise decide where to go next? Was there an overall initial plan, besides boldly going? Watching the show, I get the general impression of hopping around basically arbitrarily, which, out of universe, makes sense for 1960s TV — but is there a greater strategy, in-universe?
The original "pitch" from Roddenberry (to the Studio Execs who ended up paying for the show) was that the Enterprise was on a 5 year mission to explore a specific quadrant of the Galaxy, extending out from Alpha Centauri toward the Galaxy's edge. They would stop at each M-Class planet they encountered and they would periodically visit any human colonies or Starbases within the quadrant to restock whenever they ran low on supplies.
Galaxy exploration and Class M investigation: 5> years
You will patrol the ninth quadrant, beginning with Alpha Centuri and extending to the outer Pinial Galaxy limit.
You will conduct this patrol to accomplish primarily
(a) Earth security, via exploration of intelligence and social systems capable of a galaxial threat, and
(b) Scientific investigation to add to the earth's body of knowledge of life forma and social systems, and
(c) Any required assistance to the several Earth colonies in this quadrant, and the enforcement of appropriate statutes affecting such Federated commerce vessels and traders as you might contact In the course of your mission.
So to answer your question;
The Enterprise' broad direction of travel during their 5 year journey was chosen by Starfleet.
They're expected to travel along a roughly pre-determined path, stopping and investigating anything they find within the territory they've claimed and determining whether there's any scientific interest, potential Federation members, threats to Federation security or just anything that may be of long-term interest.
Specific course planning is chosen by Kirk and occasionally Spock.
This seems to be accomplished (thankfully off-screen) at long boring briefings with the senior staff. They're also scanning ahead and attempting to visit as many 'points of interest' along the way. Occasionally Spock will notify the Captain that he's changed the vessel's course but everyone below them needs to ask before they make anything more than minor course corrections.
Minute-by-minute course planning is accomplished by whoever is Officer of the Deck.
The aim is obviously to get to a specific destination (the one chosen by Kirk/Spock) but the OOD is expected to takes into any updated advice from the ship's Navigation Officer and Conn Officers who notify the OOD if they see anything they need to change direction for (space debris, spacial phenomena, distress signals or other potential first-contact situations, etc). The Conn Officer is also the one who actually, factually steers the ship.
From the point of the viewer, there was no plan, nor would there need to be. It was decided by what stories the writing crew needed and would be backstopped with necessary preliminary missions which the Enterprise and the other Constitution-class exploration ships would follow up on. Most of those missions were defined by Starfleet and undertaken as needed by the closest available ships.
Since the show was designed to be episodic, there would be very little need for continuity and almost no effort was made for such a thing back then. As such, there was no plan made for the show beyond being as interesting as the laws of television and the social climate would allow.
In Universe: The Federation, in theory, was spreading its influence and beliefs to species whose technological capacity would allow them membership in the Federation, presuming they weren't already under the leadership of another galactic level organization already. Thus the crew of the Enterprise likely had a flight plan and would go out and return as directed by their particular leader or commanding group in Starfleet.
The most likely plan, though never officially mentioned in great detail, would be to travel out and determine where borders to Federation space could be made and maintained, effectively protecting the planets under Federation guidance.
The Federation did not consider itself a military power, thus its ships possessed a great deal of scientific capacity on board, bolstering their claim they were involved in peaceful exploration of the galaxy, with the understanding they would defend themselves only as necessary.
Thus the border of Federation space bumped up against the Romulan Star Empire, the Klingon Empire, Tholian Space and other stellar governments with whom the Federation would have to eventually deal with as either enemies or allies.
At the beginning of many episodes of the original series, a "captain's log" voice-over says something along the lines of "we have been ordered to (planet) for (reason)"; Enterprise had frequent communication with Starfleet Command, and got new instructions for essentially every episode -- responding to distress calls or requests for help or mysterious silences from Federation colony worlds, going to the last known location of a lost sister ship, or exploring a new star system.
So the "five year mission" evidently wasn't mapped out in detail in advance, and the Enterprise wasn't so far out on the frontier that it couldn't visit interior worlds of the Federation on a regular basis.
In none of the original series episodes does the Enterprise intentionally go into "uncharted space". Searching the transcripts for "uncharted", there are references to uncharted systems or planets (Arena, The Alternative Factor), and occasional unintentional departures into uncharted space (Is There In Truth No Beauty?).
The impression is thus that the Enterprise is retreading a lot of space that's already been somewhat shallowly surveyed; often the ship's databanks already have very basic information about planets they're visiting, but not the details critical to the plot of the episode.