It may be the cat's personality; however, you may well be able to change that to some extent.
We adopted our cat when she was about two years old. (She is now about thirteen.) At first, she was very skittish and spent most of her day hiding behind furniture. It's possible that she was badly treated by her previous owner, and certainly she was traumatized by the noisy, competitive shelter. To this day she is still rather hesitant to approach strangers; and she still does not like to be picked up. (The latter is because we have not tried to alter this behavior, and usually when we pick her up we're about to stuff her in her carrier to go to the vet, or give her medication!)
Here's what we did to encourage her to be petted.
- At first, we simply got her used to being petted. To do so, we just held our hand near the side of her face, so that she could sniff our hands. Then sometimes, after a few seconds, she would gently rub the side of her face against our hand (indicating that it was OK to pet her). When she did that, we would pet her a few times, which she enjoyed. Nowadays she does not require us to follow that ritual; she is happy enough for us to come up and pet her anytime. If she wants us to stop (which is rare), she will let us know.
- It's also probably worth trying to figure out exactly how your cat likes to be petted (by how she rubs her face/body against you when you pet her). It turns out our cat particularly enjoys us rubbing the bridge of her nose, under her chin, and scratching right behind her ears. She does not like her belly to be rubbed, which is common especially in adult cats. Experiment a bit and see what she enjoys.
- After she had gotten used to being petted, we would hold our hands out a few feet away from her and encourage her to come over to us, by saying her name and patting the floor. She figured out that if she wanted to be petted, she would have to come over to us. Of course, if she came over, we would always reward her with some pets and encouraging words, to reinforce the behavior.
Nowadays she responds to her name; she jumps on the bed and purrs if she sees that we're there; and she will come over and jump on my lap (and purr) if she sees me sit down. We've even trained her to meow for treats, "stand up" and paw at my leg to get me to pet her, etc. She did not do any of this when we first adopted her -- and she was an adult at that point. So don't give up: it can be a long, slow process, but at least in our experience, it is possible and quite rewarding in the end!