Apple has restricted many things in iPhone one of them was Disabling WIFI as soon as the screen is locked to prevent battery. I’m not against it, but there are times when you download a large file from cydia using WiFi, and your screen gets locked, you lose the WiFi and download stops, this is extremely frustrating. This does not apply for iTunes and AppStore downloads. So to enable WiFi even when Screen is locked, you need to Install Insomnia from cydia. Insomnia enables applications to keep running, and WiFi will be enabled even when the screen is off. As soon as you enable you will see a small icon on your Status bar. There is also SBSettings toggle available for Insomnia through which you can quickly enable and disable Insomnia.
Insomnia is available on BigBoss repo for free