According to many biographers, John frequently talked about death. You can hear it in interviews as early as 1964 (at least, that I'm sure of). For example, during one of their Australian press conferences in '64, when a reporter had commented on how alert the boys had looked while waving to the crowd. "You're really looking at the people, aren't you? You're very aware of everything around you."
John had answered in his typical blunt style. "I think you've got to be. You might get shot."
And of course all the reporters chuckled at this witty comeback. You can watch it yourself here:
The thing is, I don't think it was a premonition so much as a preoccupation, perhaps because of John's own war with his ego, the common youthful fascination with death, or perhaps looking at the example of famous, charismatic people around him who were murdered (JFK, King, Bobbie). His own fame made him a target. The Beatles received death threats routinely, which would reinforce his perception that he could be murdered at any time.