Does God sometimes withold someone's ability to remember a dream? If so why?
Yes, actually. The reason being is it goes to what is called the "unconscious".
Dreams have a purpose... they seem to have somesort of function for us, processing the day's information, coming to terms with it. With dreams of the future, these can not only serve as markers for us... showing us God is in control... but they can be a sort of programming for our reactions. My guess would be this would be one way God would guide people without gifts, even non-Christians as well... a sort of subliminal message, as they say.
The serious stuff, He obviously has us remember. Sometimes, I have had dreams where there are very, very vivid and poetic components... but another portion of the dream runs very quickly through vivid scenes, but many of them and I don't remember the full story... but a "gestalt" of it. I had this sort of thing before I got my last job, for instance, which lasted for some years. In that case, I did, however, know there were be many memorable events.
Thinking back on that portion of the dream, I had a hunch level feeling of things, as opposed to an absolutely sure, bright as day sort of knowing.
I might also note, God operates on faith, giving us faith, and then operating through what that faith is. So your attitude about such things really effects what sort of things which might go on. Though for a sort of programming type thing, that wouldn't require faith.
This sort of thing, the subliminal message sort, might come out as people having a vague sense of "deja vu", or making a choice when presented with it that they might not have done without guidance of this sort.
Edit: This, of course, doesn't mean we don't have dreams of the flesh. We obviously do. Every human dreams and there isn't known exactly a good reason for it. One thing I have found, for instance, though... is there are a lot of times where God prepares people for a decision, to react a certain way, they ordinarily would not have reacted in. That requires a lot of effort of preparation. There is a lot God does in terms of leading people, which if one considers it deeply, they would note, we don't fully understand. Many who are led by the Spirit, for instance, towards Christ... have no idea of why or how they might feel about certain things.
Sometimes, leading is explicit. One time God gave a friend of mine a dream which caused him to perform and action, actually wake up and call me. He just followed exactly what the dream showed him and listened to a voice... apparently, never before having any sort of experience with that before at all.