As I said in the comments, we don’t have an exact age, but I’ve tried to pull together the scraps.
A few years ago, JK Rowling’s website listed the birthday of several characters, including Dobby. Sadly, she neglected to include a year, but we know he was born on 27 June, of an unknown year.
The other thing we get is this snippet from Dobby in Chamber of Secrets, when Dobby visits his hospital bed after the Gryffindor-Slytherin match.
“If he knew what he means to us, to the lowly, the enslaved, we dregs of the magical world! Dobby remembers how it was when He-Who-Must-Not-Be-Named was at the height of his powers, sir! We house-elfs were treated like vermin, sir! Of course, Dobby is still treated like that, sir,” he admitted, drying his face on the pillowcase. “But mostly, sir, life has improved for my kind since you triumphed over He-Who-Must-Not-Be-Named.”
This takes place before Christmas that year, which means the year is 1992, about twelve years after the fall of Voldemort. This means that Dobby is at least a teenager by this point in the books.
Another six or so years pass before his death in Deathly Hallows, which means he was at least a late teen when he died. But he must have spent a few years alive under Voldemort’s reign, so I think he’s probably older than that.
So he’s at least twenty, maybe older.