At your age it's normal for a boy to be thinking about sex but if you are constantly thinking about it and seeing any girl arouses you then you could be feeling embarrassed and unable to pay attention to your studies.
Next Steps
Please see a counselling psychologist for full evaluation.
Health Tips
Indulging excessively in sexually explicit material like pornography or suppressing your normal sexual instincts can lead to such addictive behaviour. Gradually stop watching porn, treat girls as any other human beings and focus on their other attributes besides the body. Talk to them about studies, hobbies, interests, future plans etc. Exercise regularly or play contact sports to burn out your physical and Sexual energy.