Verb to mean a place is getting to your head
Solution 1:
Not a single word, but for negative/harmful impacts (like both of your examples seem to be) you could use “do a number on you/your head”:
[T]his town can really do a number on your head.
(example of it used with a place from ‘Gillette: A Play’ by William Hauptman, via ‘Google Books’)
“Number, do a” (from ‘The Word Detective’):
“[T]o do a number on” … first appeared in the African-American community in the late 1960s meaning “to act with destructive impact on” … [but] has been tempered somewhat as its use became more mainstream, and it’s often now used to mean simply “affect negatively” (“Frigid temperatures can do a number on your plumbing if your pipes aren’t properly insulated,” 2010).
For a single word to use with “on,” there’s “play on/upon [his/your mind]” in the sense of having an effect on something:
play on something:
to have an effect on something; to manage something for a desired effect. (The on can be replaced by upon.)
(example of usage of “plays on his mind” from ‘The Dave Bliss Quintet: An Inspector Bliss Mystery’ by James Hawkins, via ‘Google Books’ and a definition of it from ‘McGraw-Hill Dictionary of American Idioms and Phrasal Verbs’ via ‘The Free dictionary by Farlex’)
Solution 2:
I would say "get to you", although this implies a negative effect. In fact, i would say "get to you" for a negative effect and "grows on you" for a positive effect.
"This town is really getting to me." means "I'm beginning to really dislike it."
"This town is really growing on me." means "I'm beginning to really like it."