|If your laptop runs okay on mains power but not on battery power with mains disconnected, then there's a good indication the battery has come to the end of it's useful life.|
A battery can only be re-charged a limited number of times before it needs replacing, and very often the battery isn't cared for properly. When using the laptop on mains power for a long time you are supposed to remove the battery once it's fully charged. Failure to do this shortens the batteries useful life.
A new battery is probably required, but if you do get one you should treat is described above. Also don't buy a cheap battery, get a genuine Gateway one. Will cost more but worth it in the long run. Cheap copies regularly fail, can overheat, and have even been known to damage the laptop.