In the Original Series episode "And the Children Shall Lead", before Gorgan appears a second time (at about time index 43:45 on Netflix), there is no mention of his name.
How did Kirk know the name of the entity? Did Kirk recognize the entity the first time he appears?
According to non-canon Star Trek material, Q and 0 brought Gorgan and other malevolent entities into the present dimension approximately one million years ago. This can be verified here. Perhaps the Federation database had records of his appearances before or was it possibly a previous encounter?