As Solace said, you aren't comfortable yet with having sex with a partner. Nervousness and tension are making it difficult for you to maintain an erection. This is VERY normal, and the solution is relatively simple. Reduce or stop masturbating for now, try to relax and enjoy yourself, and grow comfortable with your new girlfriend. Focus on her pleasure, and let her know you're nervous. A few days, a few weeks, and you'll be fine. Just try to enjoy being with her. I would guess that at least half of all men experience this. I did when I was young.
Hi,
It does not sound like ED, it is only a matter of retraining your brain to enjoy partner based sex.It is better that you totally give up other forms of sexual enjoyment and only concentrate on the beauty of your partner, may take a few months to get adjusted.
Solace