Different champions benefit differently from AP. You can see exactly how much they benefit by visiting http://leagueoflegends.wikia.com/ and searching for the champion.
For example, if you look at Veigar's Q, you'll see that it deals "MAGIC DAMAGE: 80 / 125 / 170 / 215 / 260 (+ 60% AP)." That means that, on activation, it will deal magic damage equal to a flat amount based on rank, plus an extra .6 damage for every point of AP he has. So, if he has 100 AP, it'll deal an extra 60 damage.
Not every champion has AP ratios like this - some only get bonus damage from AP and none from AD (such as Veigar), while others are the opposite (such as Zed), and most are somewhere in the middle. You can see the effect that AD or AP has on the damage output of your ability by hovering over the icon on the bottom of the screen - values in orange represent extra damage from AD, while values in green represent extra damage from AP (there are also some weird ones - values in red represent damage from health, and values in blue represent damage from mana. Most champions don't get damage from either of those stats, tho).