The earliest recorded use of the words "put that in your pipe and smoke it" was in a book called Americans Abroad by R B Peake and published in 1820s. It means basically 'Grasp that!' or 'Put up with that!' It is usually said as a final put-down in an argument.