Cell phone numbers are portable — you can move them from one provider to another when you switch carriers. This means that people switching to AT&T for the iPhone will be able to keep their old phone number when they buy a new iPhone (learn more about buying an iPhone).
The process of switching to AT&T for the iPhone, but keeping your existing phone number, is relatively easy as long as you don't run into a few glitches that complicated or bar the process outright.
Assuming you don't run into these problems, switching your current number to AT&T is easy - it's one step in the iPhone activation process in iTunes.
Switch Using iTunes
IPhone users activate their iPhones, select rate plans, and switch their phone numbers from within in iTunes. This is generally a pretty simple way of setting up the phone and switching your number. This will require having an iTunes account (learn how to set up an iTunes account).
My step-by-step guide to activating the iPhone includes a step on porting your number from another carrier to AT&T (step #3).
IMPORTANT: Do not cancel your current cell phone service until you have successfully transferred your old phone number to your AT&T and iPhone account. If you cancel before this is done, you will lose your old phone number.
Roadblocks to Switching Your Number
It turns out that there are a few reasons that you might not be able to switch your current cell phone number to AT&T. The most common right now, but also most temporary, is that AT&T's system for activating phones has been overwhelmed by the volume of new iPhone activations. As that volume slows down, activations will speed up and number transfers will become quick affairs again. Right now, they're pretty slow.
The other reasons that could prevent the transfer — and these are harder, if not impossible to get around - involve some arcane contractual stuff. For instance, if you're trying to switch a number from an area code where AT&T does not have a contract to provide service, you won't be able to switch (as I found out, much to my frustration).
There's also a confusing situation that arises from your original billing address for the phone number being different than the current one and in another state.
Since neither of these issues can be fixed, before you buy an iPhone, it makes sense to use AT&T's online number portability tool to make sure that you'll be able to port your number.

