Problem: Sensor on top of screen is being covered by a hard or soft case.
Solution: Remove after-market case (e.g.Pdair leather cover)
Explanation: It's because you have the phones proximity sensor covered or it is impaired. The proximity sensor detects when the phone is close to something, i.e. your ear, and locks the screen so no accidental touches interferes with your call, i.e. your ear pressing the hang-up button and ending the call.