Shakespeare uses the word "desk" in two plays: Hamlet, Act II, scene 2 (cited in the question) and The Comedy of Errors, Act IV, scene 1, where Antipholus of Ephesus says (emphasis added),
To Adriana, villain, hie thee straight:
Give her this key, and tell her, in the desk
That's cover'd o'er with Turkish tapestry,
There is a purse of ducats; let her send it:
This suggests that "desk" refers to a type of furniture where you can store things and that you can lock with a key. Because of this, it can also be used for storing things that the owner wants to keep secret.
There are several such "desks" in the Victoria & Albert Museum in London. For example, an oak desk from around 1600, an inlaid table desk from the years 1580-1620 and the Duke of Urbino Writing Desk from around 1600.
Wikimedia has the following image of Henry VIII's writing box:

In the cited passage from Hamlet, Polonius asks Claudius what he (the king) might have thought of him if he had kept his knowledge about Hamlet's and Ophelia's relationship to himself (instead of telling Ophelia she should avoid prince Hamlet).