Calling someone a "smart aleck" (sometimes smart alec) is generally used to imply that someone is either a smart ass (wise ass, cracking wise) or that someone is too smart for their own good.

As usual The Straight Dope website can lead us to the etymology: According to G.L. Cohen, author of Studies in Slang Part 1 (1985), the phrase smart alec(k) arose from the exploits of one Alec Hoag. As they point out, other sources seem to be in agreement on the subject as well. The majority of dictionaries agree (including the Oxford English Dictionary,) though some more tentatively than others.

Mr. Hoag is apparently famous for his successful use of the "panel game", in which pimps and prostitutes would enter a room through the use of sliding wall (panels) and catch a client with his trousers down in order to easily rob him.

References:

  1. Czarcasm, What's the origin of "smart aleck"? The Straight Dope, July 12, 2001. (http://www.straightdope.com/mailbag/msmartalec.html)
  2. Smart aleck. The American Heritage® Dictionary of the English Language, Fourth Edition. Houghton Mifflin, 2000.