Old English æfter "after, next, throughout, following in time, later," from Old English of "off" (see of) + -ter, a comparative suffix; thus the original meaning was "more away, farther off." Cf. Old Norse eptir "after," Old High German aftar, Gothic aftra "behind." Cognate with Greek apotero "farther off."
After hours "after regular working hours" is from 1861. Afterwit "wisdom that comes too late" is attested from c.1500 but seems to have fallen from use, despite being more needed now than ever. After you as an expression in yielding precedence is recorded by 1650.