Should stereo panning be done differently while using headphones or speakers?
With headphones you will get complete separation of left and right channels. You will only hear the left channel in the left ear and the right channel in the right ear, assuming you don't listen at insane volumes or put the headphones on backwards :)
With speakers, aside from the reverb and echos in the room mentioned by @Eugene, you will still hear at least some of the left channel in the right ear and some of the right channel in the left ear.
Panning an instrument hard to one side can sound very different using headphones than it will using speakers.
So, to answer your question:
Yes, it should be done differently because it has the potential to sound very different.
You should also keep in mind how your audience will be listening to your music (assuming you are doing music). There is a very good chance that your listeners will use both headphones (on an MP3 player or phone) and speakers (in the car). This will make it necessary for you to use both to make sure that they hear your music the way you want it heard.
For the most part, with centered mixes, there is very little difference between speakers and headphones other than the impact of the acoustics of the room versus the sterile headphone environment.
When you get in to stereo panning, however, an interesting thing happens. In a room, both ears hear sound from both speakers, so a sound coming only from the left speaker is heard by both ears, but by different amounts and the brain figures out that it is naturally originating from the left speaker.
With headphones on the other hand, each ear only hears what is presented to it. If it is only in the left ear, then only the left ear can hear it and the right ear can not. This tells the brain very clearly that the sound is very close to the left ear and kills any kind of feeling of space that the mix would otherwise have when listening on headphones.
So what is the conclusion of this difference? When mixing for headphones versus speakers, there isn't a lot of difference in the panning until you get near the extremes of left or right panning. Unless you specifically want the overly strong pan (for a special effect for example), you want to make sure that you are always leaving a healthy portion of the sound in both sides of the mix if the intended audience is headphones. While mixing for a room however, it can be perfectly fine to separate the audio more completely in to the left and right channels.
Well, I don't think that there will be much difference in stereo panning when using headphones rather than speakers since in both cases you have a correct stereo image provided by 2 sources. Of course there will be a difference in what you hear as described by @AJ Henderson but there's nothing you should do differently in sense of mix.
However another issue to take into account is the "Depth perception". When you use your headphones, the sound reaches your ears directly from 2 point sources. But when you use speakers, you also hear the reverberation and echoes caused by the space you are in.
But again, there should be no special issued when mixing (and specifically panning) while using headphones.