Harry and the others in his year sit their Ordinary Wizarding Level (O.W.L.) examinations.
O.W.L.s occurs over the span of two weeks.
First week of O.W.L.s: Monday – Charms (written exam in the morning and practical in the afternoon); Tuesday – Transfiguration (written exam in the morning and practical in the afternoon); Wednesday – Herbology; Thursday – DADA (written and practical), Friday – Ancient Runes (Hermione sits this, but Harry and Ron do not.)
Second weeks of O.W.L.s: Monday – Potions (written exam in morning and practical in afternoon); Tuesday – Care of Magical Creatures (practical in afternoon); Wednesday – Astronomy and Divination (Astronomy theory in morning, Divination in afternoon, Astronomy practical at night); Thursday – History of Magic (at 2:00 PM)
Chapter 31, in which the O.W.L.s are sat, starts from the day after Gryffindor's Quidditch Victory (Sunday, May 31), then goes through probably a week of studying for O.W.L.s and then almost two weeks of exams. We do know that Harry's last exam day, on which the next few chapters take place, is Thursday of his second week of exams - probably June 18.