Old English æt, from Proto-Germanic *at (source also of Old Norse, Gothic at, Old Frisian et, Old High German az), from PIE root *ad- "to, near, at." Lost in German and Dutch, which use their equivalent of to; in Scandinavian, however, to has been lost and at fills its place.
At is used to denote relations of so many kinds, and some of these so remote from its primary local sense, that a classification of its uses is very difficult. [OED]
In choosing between at church, in church, etc. at is properly distinguished from in or on by involving some practical connection; a worshipper is at church; a tourist is in the church. In 19c. it was used for points of the compass as regions of a country (at the South) where later tendency was to use in.
The colloquial use of at after where (as in where it's at) is noted in Bartlett (1859). At last is recorded from late 13c.; adverbial phrase at least was in use by 1775. At in Middle English was used freely with prepositions (as in at after, which is in Shakespeare), but this has faded with the exception of at about.