The moon landing would have probably happened during JFK’s second term, if he hadn’t been assassinated and if the Apollo 1 tragedy hadn’t set the project back significantly.
I don't think his assassination had anything to do with Apollo 1, so I take it it probably would've still happened even if he were alive.
Similarly, I don't think his assassination set back the project (ChatGPT says it probably reinforced support for the program, if anything, fwiw).
So, I imagine if he hadn't been assassinated, they probably would've landed on the moon around the same time, which would be after a possible 2nd term (unless he lost re-election and then won again).