Ubuntu, like most versions of Linux, has support for a very small number of wifi chipsets. There may be thousands of brands of wifi adapters but inside there not nearly as many different chipsets... but still lots more than Ubuntu has bulit-in support for.
Try disabling your current wifi adapter and install a completely different brand of wifi adapter (maybe you can borrow one from a friend for this test). Then see if it works better. If so, you stumbled on an adapter compatible with Ubuntu's drivers. Stick with it.
Your Ubuntu 12.04 Wi-Fi has issues with the connection probably because there's an interrupted link to your router. You might also need to check your IP assignment. If the connection remains interrupted, you can contact customer support with the information provided at http://www.ubuntu.com/contact-us.