Laws regarding driving while distracted vary from state to state, so it depends upon where you live. Because headphones are technically hands-free, you won't run afoul of cell phone laws.
From a common sense perspective, driving with headphones on is not a particularly good idea. Unlike listening to your car's speakers, wearing headphones blocks out outside noise and messes with your ability to distinguish directionality. So if you hear, say, screeching breaks or a car horn, you may not be immediately able to tell where it's coming from, and that will cost you precious reaction time. You could miss warning sounds altogether if you have the volume turned up.
Laws about driving while distracted are there for a reason, and it isn't to collect gratuitous fines. It's to protect people--and other motorists who have to share the road with them--from their own poor judgement.