Yes, you just upgrade to an AP and pay the difference b/t what your 2 day pass was and the price of an AP. I think you go to Guest Relations, but I'm not positive.
As Stampinshauna said, "Yes, you can!" When you go into Disneyland, just go to the AP processing center which is on Main Street just after you enter from the tunnel on the right side. (It used to be the Bank.) They will credit you the amount you paid for your two day hopper toward your new AP. There are several different AP options, so choose the one that will work best for you.
As others have said, if you are choosing an AP that has blackout dates, use your hopper for any applicaple black out dates during your stay, and then upgrade. Upgrades must be made while your ticket is active, and your AP will be back dated to the date your park hopper ticket was first used.