It's understandable that you're going to be attracted to attractive women. This is the way God made us. But when we commit to a woman, we need to use our willpower to keep our eyes (and heart and mind) on the one we have chosen, out of respect for her. This is not always easy, considering how most girls dress nowadays. But it is always possible. Begin by not staring at other girls when your girlfriend is not with you, and it will be easier to have control over your eyes when your girlfriend is by your side.
When you gawk at other women, it's like you're saying to your girlfriend that she's not enough for you. This may not be how you feel, but it's the message you send. Just imagine how it would make you feel if she was always staring at other guys. To show your love for her, keep your eyes on her. If you see a beautiful woman, turn your attention back to her. When you go out to a restaurant with her, take the seat facing the wall so that she knows your attention is on her and not on the cute hostess walking by. It's these small challenges in a relationship that prove your love.