What exactly makes a starbase a starbase as opposed to a space station such as K-7 or DS9. Could a planet bound station such as Farpoint be a starbase?
Memory Alpha defines it as follows:
A starbase was a permanent support facility operated by Starfleet, consisting of space stations, drydocks, and/or ground installations
So, this means that yes, Farpoint station could be considered as a Federation starbase, provided it was run by Starfleet.
I think the key point here is that it needs to be run by Starfleet to be a Federation starbase. K7 was run by Federation civilians rather than Starfleet and in the transcript it is described as a 'space station' rather than a 'starbase'.
I think this is a matter of taxonomy: a starbase encompasses a range of facilities, but a space station (like K7 or DS9) is a category within a starbase, specifically one that is in space.
A continuation of my previous answer.
And here is an example of a Next Generation era starbase with buildings on a planet. Starbase 515 from "Samaritan Snare".
The distinction between a starbase and a space station is that their definitions only partially overlap.
A starbase is a Federation and Starfleet outpost to repair, supply, and support starships in interstellar space far from the main planets of the Federation. A starbase may consist of planetary surface buildings and facilities and/or orbital facilities.
A space station is a Federation and Starfleet or a non Federation and non Starfleet non spaceship structure floating in space. The present International Space Station is not operated by Starfleet, for example. It may orbit an asteroid, a moon, a planet, a star, or other astronomical body, or it may float in interstellar or even intergalactic space. Large enough space stations may be considered space habitats. The structural definition of a space station does not include any ground or surface facilities that may be associated with it, though the administrative definition of a particular space station may include associated ground facilities.
Thus it is seen that some, but not all, starbases are space stations or include space stations, and some, but not all, space stations are starbases or parts of starbases.
At least some parts or sections of some starbases are on planets in at least one era of Star Trek.
Here are images of Starbase 11 from the original and remastered episodes "Menagerie" and "Court Martial" in the first season of Star Trek: The Original Series.
At least some parts or sections of at least some starbases are in orbit around planets in at least one era of Star Trek.
Here are images of Starbase 74 at Tarsas III from the episode "110010001" in the first season of Star Trek: The Next Generation and "The Measure of a Man" in the second season.
Starbases were numbered up to the hundreds in the era of STNG, and were often mentioned, but I don't remember seeing actual images of many other starbases in any Star Trek movies and TV series. Thus it is hard to estimate the relative ratio of ground and orbital facilities in starbases and if it changed from era to era.