They vibrate at different frequencies. The same vibration will also sound different depending on the string or column of air that produces it.
A piano has a top that traps the sound.
A, A#, B, B#, C, C#, D, D#, E, E#, F, F#, G, G# Ab Bb Cb Db Eb Fb Gb (b = blunt, # = sharp [the black keys])
a note u play, a rest u dont
Notations that specify duration indicate how long to hold the note. This is how we create rhythm. If there were only one duration, all music would rhythmically sound the same and that would be boring.