men can become so accustomed to masturbating that it is the way they need to ejaculate or have an
orgasmOrgasmic dysfunction. But it really shouldn't affect erection. Erections are a combination of arousal and physical ability to get enough blood into the area to make the penis rigid. If he is having erection problems I don't think it is due to masturbation. It could by a physical problem- and if he has problems sustaining a good erection when he is masturbating he should see a urologist. It is more likely , however, that some fear or anxiety, or yes, relationship issue, is interferring with his ability to get hard.
How honest do you think he is about what is happening? It could be anything- from worrying about performance to guilt for being with someone else- or issues about the relationship that he is not expressing to - well, the sky is the limit. You have to talk tohim about what is really going on in his life, his emotions, his world when you aren't in it. Erection difficulty in a young man is not rare- but there is no need to have it happen all the time. It is fixable- if he levels with you about what he thinks is really going on.