You have to switch your number to a new (or old) phone before you sell your Droid.
You buy the iPhone and activate it. You number will them be associated with the iPhone and you can sell the Droid. Alternatively, if you're counting on using the money from your Droid to buy the iPhone, then you can activate your number on an old phone (if you have one lying around) and then sell the Droid. After that, you can upgrade to the iPhone and port your number to it.