In Star Trek Chronology, the above two images are featured. I was just wondering what their source is as I don't recall seeing the Enterprise in spacedock during the series or movies.
After much searching, it seems that the key to understanding the images in the original post is the following concept art:
The notion of an "orbital drydock" for repairing and refitting starships was first developed for Star Trek: Phase II (a television continuation of The Original Series that was aborted in favour of The Motion Picture, with various ideas from the project also being channelled into the film).
The above sketch, made by artist Mike Minor around 1977 while Phase II was being developed, is the original idea for the drydock.
It clearly shows the original USS Enterprise (no refit) in the drydock structure.
When Phase II was abandoned and The Motion Picture was announced, Minor's design was dropped in favour of one by Andrew Probert. The following sketch by Probert (1978) shows an Enterprise that is very close in appearance to the refit one, sitting in the drydock:
What is really important to note is that, according to this detailed site (where I found the above sketches), the first working model of the drydock was built in 1977, two years before The Motion Picture came out.
The 1977 model of the drydock was based expressly on Mike Minor's design, not on Probert's, and was built by Magicam. According to the site, this model "closely resembled the final product" that was seen two years later in The Motion Picture.
Given that the original Magicam drydock was based on Minor's design, which was intended for the original Enterprise, and given that Probert's refit Enterprise wasn't devised until at least a year later, we can conclude that a model of the original Enterprise would have been placed into the 1977 Magicam drydock model — indeed, there is no record of any other type of model of Enterprise existing at that time — thereby creating the most likely source of photos of a non-refitted Enterprise in drydock for Star Trek Chronology.
The photos you posted are from the space dock in the opening scene in the movie Star Trek II "The Wrath of Khan." The photos are not from the same angle, but it's the same spacedock. You can tell that those photo's are from that particular space dock by the unique windowing of that space dock not seen elsewhere. Lt. Saviik is piloting the Enterprise out of that particular space dock. At the 2:40 & 2:50 mark of the following video you can clearly see the windows I'm talking about and match them up with the photo's you posted.
The photo on the left appears to have rectangular nacelles on my screen. Either way there are no instances of a docked Enterprise in the series or movies anywhere with round nacelles. But to answer the your first question at least partially, as I stated, that spacedock is from "The Wrath of Khan."
To answer the second part of your statement about not remembering when the Enterprise was in space dock.
Aside from Star Trek The Motion Picture, which you have already mentioned, there are other instances of the Enterprise being in space dock. For ST: "The Motion Picture" see 1:28 mark of following video:
The enterprise is clearly seen in space dock in the third movie, "The Search for Spock." At the beginning of the movie the crew steals the Enterprise and the Excelsior gives chase. The enterprise is seen in space dock several times and is seen leaving space dock. Just watching the scene puts a smile on my face, love it when Kirk ignores Starfleet. This is the infamous scene with the famous/infamous warp vs. transwarp drive (that sputters and kerplunks). Here is a Youtube link to that wondrous scene (Check the 4:23 mark if for some reason you don't want to watch the whole clip):
In the sixth movie "The Undiscovered Country" the Enterprise A is seen inside and then leaving space dock. Check out 1:06 of this Youtube clip: