Old English wis "learned, sagacious, cunning; sane; prudent, discreet; experienced; having the power of discerning and judging rightly," from Proto-Germanic *wissaz (source also of Old Saxon, Old Frisian wis, Old Norse viss, Dutch wijs, German weise "wise"), from past-participle adjective *wittos of PIE root *weid- "to see" (hence "to know"). Modern slang meaning "aware, cunning" first attested 1896. Related to the source of Old English witan "to know, wit."
A wise man has no extensive knowledge; He who has extensive knowledge is not a wise man. [Lao-tzu, "Tao te Ching," c. 550 B.C.E.]
Wise man was in Old English. Wise guy is attested from 1896, American English; wise-ass (n.) by 1966, American English (probably a literal sense is intended by the phrase in the 1607 comedy "Westward Hoe" by Dekker and Webster). Wisenheimer, with mock German or Yiddish surname suffix, first recorded 1904.