Does my Lumia close Wi-Fi connection when the phone screen switches off?

This depends on which Lumia Windows Phone version is currently installed on your phone, go to Setting > extras+info:

Lumia Cyan (and onwards): Your phone has a new feature AOAC (Always-ON-Always-Connected), which keeps Wi-Fi active all the time in the background, if Wi-Fi networking is enabled in settings menu.

Lumia Black or earlier: You can control the Wi-Fi connections: Tap Settings > Wi-Fi > advanced. Remove the tick from Keep Wi-Fi on when screen times out to close Wi-Fi connection when the phone screen switches off.