My WiFi goes dead and I can’t connect anymore.

Hello experts,
I am having problems on my Samsung Galaxy SII. I am unable to connect through Wi-Fi. It just simply stops on getting signals from any wireless connection. If I disconnect and then connect again through Wi-Fi, it will work fine. However, once my Galaxy SII is not in use, the Wi-Fi disconnects.
How can I fix it?
