This is a Remembrall. It turns red when the user has forgotten something.
Its most famous user is Neville Longbottom, who can never remember what he's actually forgotten.
But in fact, it's really obvious – he forgot his robes!
And it's probably a good thing he eventually remembers them, since they end up saving his life a little while later.