Is it possible to turn off external displays when I close the lid of my macbook?
As macOS doesn't provide a way to shutdown all screens by closing the laptop lead, which is a shame, you can put the laptop in sleep mode and also set security parameter to lock it immediately when it goes to sleep so you can leave once the screen is black.

If you have a MacBook with Touch Bar, you can also add the sleep icon to it :  

I put it on the left to be sure not to touch it when i hit the fingerprint sensor or the delete key...

To modify the touch bar, go to system preferences/keyboard and you will find a "customise touchbar" on the bottom right corner.