Depends on the episode and the situation.If the captain of the NAe São Paulo (a aircraft carrier) were asked what country his ship was from, he would say Brazil, even through the ship was constructed at a shipyard in Saint-Nazaire, France.I assume since the Enterprise was built at Earth (starbase? Orbiting Earth), literally it is from there and would consider Earth its home base.
If the Enterprise were a Federation ship (and not a Earth ship), regardless of where it was built, why would Kirk refer to as being from the planet Earth?
During TOS and the episode Assignment Earth, the Enterprise by appearances was very much not home based at Earth
Spectre Of The Gun said:KIRK: This is Captain James T. Kirk of the starship Enterprise, representing the United Federation of Planets. We've contacted your buoy and understand its message. We hope that you will understand that our intent is to establish peaceful relations with you. Lieutenant, answer?
Elaan of Troyius said:KIRK: This is Captain James Kirk of the USS Enterprise on Federation business. Our mission is peaceful, but we're not prepared to accept any interference.
Let That Be Your Last Battlefield said:KIRK: You're aboard the starship Enterprise.
LOKAI: I've heard of it. It's in the United Fleet of Planets?
KIRK: Federation. So was the shuttlecraft that you were flying in.
A Piece Of The Action said:KIRK: Boss? All right, Lieutenant, put him on. Oxmyx. This is Captain James T. Kirk of the starship Enterprise, representing the Federation of Planets.
The Gamesters Of Triskelion said:KIRK: Thralls? You must be mistaken. We're officers of a United spaceship on Federation business.
Friday's Child said:MAAB: Halt! You are of the Earth vessel?
KIRK: I'm Captain Kirk.
Errand of Mercy said:KIRK: I am Captain James T. Kirk of the starship Enterprise, representing the United Federation of Planets. This is my first officer Mister Spock.
A Taste of Armageddon said:KIRK: I'm Captain James T. Kirk of the starship Enterprise, representing the United Federation of Planets.
Tomorrow is Yesterday said:KIRK: We're a combined service, Captain. Our authority is the United Earth Space Probe Agency
The Corbomite Maneuver said:KIRK: This is the United Earth ship Enterprise. We convey greetings and await your reply. What is it, Mister Bailey?