I was donated a Samsung Galaxy S3 and whatever I look up or try it's not possible to lock the screen while either on a call (it was meant to do it automatically) or in your pocket. The only offer in settings> security is to set a password but nothing like my other phones when it's just a lock screen where you press something to unlock it. There are two different settings menus depending which model you have so the online examples are not applicable to my phone.
To lock the screen, simply press the power button. The methods available for unlocking, and how you set them up will depend not on the model of the phone, but on the version of Android that you are running.
That was the old method, it did blacken the screen, but now any notification or even a change of wind direction sets it off vibrating and bleeping again and tends to phone the person I'm already talking to or voicemail. It ought to override any internal event but not any more. It's also started to echo on many calls at the other end and wonder if it's coming to the end of its time.