Is the sentence "I didnt get to hear from you for a long time." correct?
It's unusual. You wouldn't use it if you simply hadn't heard from someone for/in a long time. Maybe if you were in prison and they were witholding your mail, you could say that - that is, if the person has tried to contact you, but you couldn't access that communication for some reason.
In what context do you want to use it?