In Randolph's distress call to Starfleet Command, he noted that the ship had lost all power and that all non-essential crew were given hiber-sedatives to slow down consumption of life support reserves. Meanwhile, the chief engineer attempted to deploy a makeshift solar sail so as to focus and absorb radiation from a nearby sun they were orbiting, with the hopes of generating power to keep the crew alive. (Star Trek IV: The Voyage Home)
The "United Space Ship Yorktown" (identified as SS Yorktown) was the name of the central starship in Gene Roddenberry's first Star Trek proposal to NBC in 1964. The ship was named for the USS Yorktown (CV-5), a World War II American aircraft carrier, which in turn was named after the last major battle of the American Revolution, won in 1781 by a combined Franco-American army commanded by Gen. George Washington. (Star Trek Encyclopedia (4th ed., vol. 2, p. 509)) Coincidentally, the historical World War II Yorktown was a class sister of the historical USS Enterprise (CV-6), after which Roddenberry ultimately named his starship. (The Making of Star Trek, p. 164)
According to the Star Trek Encyclopedia (4th ed., vol. 2, p. 509), "Roddenberry reportedly suggested the second USS Enterprise-A, launched at the end of Star Trek IV, had previously been named USS Yorktown since it seemed unlikely that Starfleet could have built a new Enterprise so quickly. If this was the case, the Yorktown may have made it safely back to Earth and been repaired and renamed, or perhaps there was a newer, replacement Yorktown already under construction at the time of the probe crisis." The latter scenario could be supported by dialogue from Star Trek V where the Enterprise is described as a "new ship" by Scotty, whereas the former scenario serves as a convenient rationale for the difficulties Scotty had of getting the ship back in operational order after the debilitating effects the Whale Probe had inflicted on it.
The season four internal studio document, Star Trek: The Next Generation Writers' Technical Manual (2nd ed. p. 6), co-written by Encyclopedia Co-Author Michael Okuda, emphatically stated this to be the case, reaffirmed in the later officially licensed Star Trek Fact Files and the 2010 reference book USS Enterprise Owners' Workshop Manual. This was further validated when, in later Encyclopedias, Okuda described the 2293 Yorktown as the second ship to bear the name. The Starfleet practice of renaming a vessel for a very deserving other vessel was later canonically established in Star Trek: Deep Space Nine episodes "The Changing Face of Evil" and "The Dogs of War", when the USS Sao Paulo was rechristened as the USS Defiant, when the original Defiant was destroyed in the Dominion War. The Encyclopedia, Star Fleet Technical Manual, and all other reference works confirm the Yorktown being a Constitution-class heavy cruiser. The producers of Star Trek: The Original Series had the name included on their final fourteen ship list at the start of its second season, belonging to the Constitution-class, then still referred to as "Starship-class" by them. (The Making of Star Trek, pp. 164-165)
Incidentally, renaming vessels that were either under construction or recently constructed for by then lost in action counterparts had a real world basis, as it became established practice in the United States Navy to do so for aircraft carriers in World War II, these having become the most valuable assets in the war against Japan. However, it is very rare to rename a serving ship; it is considered "unlucky." Aside from honoring these lost ships, it also served to confuse Japanese intelligence at the time.
NCC-1717 was the registry number given to the Yorktown by Gregory Jein in his influential "The Case of Jonathan Doe Starship" article, published in the April 1973 issue 27 of the T-Negative fanzine.  Okuda took his cue from Jein's article and further propagated the registry in his reference work writings, most notably the Star Trek Encyclopedia. NCC-1704 was the registry number assigned to the Yorktown by Franz Joseph in the unofficial Star Fleet Technical Manual.
Its non-canon status notwithstanding, both fanon and the above mentioned production staffers have firmly embraced the 23rd century ship as being the "[U]SS Yorktown (NCC-1717), Constitution-class", as was amply demonstrated when the British, officially licensed, partwork publication Star Trek: The Official Starships Collection released a convention-exclusive model of the ship as such in 2016.
In the Star Trek: The Next Generation novel Crossover, the Yorktown was revealed to have become a museum exhibit on a starbase, but its bridge has been replaced with the original bridge of the first USS Enterprise. In the story in question, Captain Montgomery Scott stole the Yorktown to rescue Spock, recently captured by the Romulans, and fitted it with an ancient Romulan cloaking device (the one acquired in "The Enterprise Incident"). The mission proved successful, but aid was still required from the USS Enterprise-D for Spock, Scotty and the Unification movement to escape.
In Star Trek Online, the Yorktown serves as Admiral Isaac Garrett's flagship during the Battle of Caleb IV and is one of the only Starfleet ships to survive the battle after being ambushed by Kor's battle group. The vessel's alternate reality counterpart, also Constitution-class, makes a brief appearance in the mission "Terminal Expanse", attempting to disable a Delphic Expanse sphere in the Beta Quadrant.