It is your personal choice whether to watch porn movies or not; masturbate or not. From a medical point of view, both of them are harmless activities. However, you should not over-do them and don’t allow them to affect your day to day activities including academic performance. Don’t feel guilty about them but please don’t become addicted to them.