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.
The additional isolation that headphones give is going to make a significant difference. If you put a signal entirely in the right channel for headphones, the left ear will not hear it. If you do the same in a room with speakers, it will still result in a natural sound.– AJ Henderson ♦Apr 30, 2013 at 14:58
@AJHenderson Of course it will make a difference but there is nothing you can do about it. For example when mixing, you are not going to create a different mix for listening using speakers or headphones.– Eugene SMay 2, 2013 at 9:13
oh, I think I get what you are saying now. You are saying there won't be much difference in how you perform stereo panning, not the impact of it. That wasn't really clear to me from your answer. If you make that more clear, I'll remove the downvote and change it to an upvote. Just be sure to comment back so I remember to check back. :)– AJ Henderson ♦May 2, 2013 at 16:58
@AJHenderson Yes, I agree. It didn't sound very clear. Well I made some clarification, hope it reads better now.– Eugene SMay 2, 2013 at 17:06