Old English wæcce "a watching," from wæccan (see watch (v.)). Sense of "sentinel" is recorded from c.1300; that of "person or group officially patroling a town (especially at night) to keep order, etc." is first recorded 1530s. Meaning "period of time in which a division of a ship's crew remains on deck" is from 1580s. Sense of "period into which a night was divided in ancient times" translates Latin vigilia, Greek phylake, Hebrew ashmoreth.
The meaning "small timepiece" is from 1580s, developing from that of "a clock to wake up sleepers" (mid-15c.).