"Good-bye, Dobby."
--Harry's last farewell to the elf (DH24)

After being killed by Bellatrix Lestrange’s knife (DH23), Dobby is laid to rest near Shell Cottage.
Harry digs the grave by hand. As he does this, he is aware of the anger Voldemort is feeling, but Harry’s own grief is much stronger. The frustration and loss help Harry to remember what is really important, and his overwhelming obsession with the Deathly Hallows subsides. Ron and Dean Thomas eventual come to help Harry dig. Harry wraps the body in his coat, Ron puts his shoes and socks on Dobby’s feet, and Dean adds his hat.
They are then joined by Hermione, Luna, Bill, and Fleur. Luna closes Dobby’s eyes to make it look like he is sleeping, then praises Dobby’s character and thanks him for rescuing everyone from the Malfoys’ cellar. Harry feels that Dobby ought to have a grand, stately funeral like Dumbledore’s.
After Bill uses magic to fill the grave, everyone leaves but Harry, who stays behind for a moment of solitude. He makes a headstone for Dobby’s grave from a white stone on which he magically engraves, “HERE LIES DOBBY, A FREE ELF.” (DH24)
Timeline Notes
We know that it happens sometime in March, and in the morning - Harry starts digging the grave before sunrise.
Commentary
Notes
The idea of "rest" (as opposed to death) is present throughout this event. When Harry covers Dobby's with his (Harry's) coat, it is likened to a blanket rather than a shroud. Luna suggests they close Dobby's eyes, and, after gently doing so, says, "now he could be sleeping." Then Harry poses the limbs to make it look possible that Dobby is merely resting. Harry places the white stone above Dobby's head as if it were a pillow. Finally, Harry inscribes the stone with the words "HERE LIES DOBBY," which seems an odd conflation of person and body, given how much Harry and his friends now know about souls. Curiously, Dobby is "laid to rest" as morning dawns. Also, Harry's personal growth while digging the grave is described as like being "slapped awake". -BB
Harry regaining perspective as he prepares to bury Dobby is a key event. When Dumbledore tells Harry that he (Harry) is the better man, his reason is that Harry, unlike Dumbledore, matured past an obsession with finding the Deathly Hallows (DH35). -BB
In tune with the ideas of literary alchemy used throughout the series, the ebb and flow of the waves on the beach as Harry changes his thinking represents purification by washing away with water. The completion of that process is indicated by the whiteness of the stone Harry places over the grave.-BB
While Harry is certainly right that Dobby's funeral did not match the grandeur of Dumbledore's funeral, it should be noted that both funerals occurred by the shore of a body of water, and the location of both bodies is marked with white stone. -BB
Harry, Ron, and Dean putting their clothes on Dobby's body is significant because Dobby's freedom was so important to him. Ron's gift of socks is particularly notable because socks were Dobby's favorite items of clothing (GF23) and a symbol of his own liberation (CS18), and because Ron knew the significance socks had for Dobby and had grown up believing that their was nothing wrong with the enslavement of House-Elves. -BB
Harry feels that he is showing proper respect by digging the grave without magic. Perhaps this is an act of solidarity because House-Elves are not allowed to use wands or because of how much hard work they have to do. -BB
Harry pointedly digs Dobby's grave without the use of magic, but Bill fills the grave instantly with a wave of his wand. -BB
Like Bill did at Dobby's funeral, Professor Slughorn filled Aragog's grave with a silent want movement (HBP22). It is unclear whether both wizards are adept at nonverbal magic for a more common movement charm or if there is a spell specifically for filling graves. -BB