Harry meets Dobby in Chapter 2 ("Dobby's Warning") of Harry Potter and the Chamber of Secrets (Book 2).
Context: Dobby appears in Harry's bedroom at the Dursleys' on the evening of July 31 (Harry's 12th birthday), warning him not to return to Hogwarts. The chapter is early in the book—after the Dursleys' dinner party disaster (Chapter 1).