Apple iPhone screen problem
It sounds like you are referring to the proximity sensor, which is meant to turn the screen off when you are on a call (so that your face doesn't press any buttons). However it shouldn't do it if you're not on a call. Can you clarify when it is doing it?