Oído: the whole organ or organs of hearing
Oreja: just the "external ear".
This is the definition of ear according to the Webster dictionary:
ear noun \ˈir\
Definition of EAR
1 a : the characteristic vertebrate organ of hearing and equilibrium consisting in the typical mammal of a sound-collecting outer ear separated by the tympanic membrane from a sound-transmitting middle ear that in turn is > separated from a sensory inner ear by membranous fenestrae
b : any of various organs (as of a fish) capable of detecting vibratory motion
2: the external ear of humans and most mammals
According to this, oído refers to definition 1, and oreja to definition 2.