Wheatley is the artificial intelligence responsible with the "least desirable job available" - attending to those "smelly" humans in the Extended Relaxation Center of Portal 2. According to GLaDOS, Wheatley was originally designed as an Intelligence Dampening Sphere designed to generate a constant stream of stupid ideas, thereby distracting GLaDOS and hampering her decision-making process.
For the first half of Portal 2, Wheatley act's as Chell's sidekick and guide as the two try and escape the Enrichment Center. While searching for a switch to power the escape pod, he accidentally reactivates GLaDOS. Convincing Chell to insert him into the mainframe and replace GLaDOS, he instantly becomes power-crazed and takes over as the games main antagonist.
He is described as a "moron," designed to do "incredibly stupid things," by GlaDOS. He may be a computer, but he is a horrible hacker, mostly just guessing passwords.