It basically means "what do you think of that!?" in a very smug manner.
In the Good Will Hunting scene, Damon takes the expression and stretches it out, asking the other guy "Do you like apples?" (which sounds like a normal question, albeit a strange time to ask) so he can really rub it in when he shows off the girl's number.