You can try a custom rom or some apps in the Play Store, but as far as I know they are going to use a lot of battery juice. It doesn't work very well if that feature wasn't built in your phone.
It's very easy to lock your screen though using some apps (screen off & lock is my choice), and you can even set a gesture for that action when using a third party launcher, as Nova.