These two words were inscribed on the oracle-shrine of Apollo at Delphi, Greece (6th century B.C.).
According to The Perseus Project:
In Grendel the phrase appears in some of the Dragon's final words to the monster. He gives what seem to be three distinct bits of advice: "Know thyself," that's my dictum. Know how much you've got, and beware of strangers!" (74)
In the Dragon's nihilistic world-view, material possessions are all you can (literally) count upon. One must beware of strangers because they can take what you have. This may be all the Dragon can mean by "Know yourself" - aside from a general mockery of the notion that anyone can know anything at all, let alone oneself.
But who is Grendel? With his noticeable lack of interest in piling up gold, what does he come to know about himself throughout the novel?