The exams had been cancelled
At the end of the 1992-1993 school year, when the Chamber of Secrets was reopened, no exams were held at the end of the year:
"Harry didn’t know whether the best bit was Hermione running toward
him, screaming “You solved it! You solved it!” or Justin hurrying
over from the Hufflepuff table to wring his hand and apologize
endlessly for suspecting him, or Hagrid turning up at half past
three, cuffing Harry and Ron so hard on the shoulders that they
were knocked into their plates of trifle, or his and Ron’s four
hundred points for Gryffindor securing the House Cup for the second
year running, or Professor McGonagall standing up to tell them all
that the exams had been cancelled as a school treat (“Oh, no!” said
Hermione)..."
- Harry Potter and The Chamber of Secrets
O.W.L. and N.E.W.T. exams were probably still held (see the accepted answer of this question on the subject of exams held by the Wizarding Examinations Authority)
but none of the four pertified students were in their O.W.L./N.E.W.T. years.
Colin Creevey was in his first year,
Justin Finch-Fletchley and Hermione were both in their second year and Penelope Cleanwater was in her sixth year.
I couldnt find any information on how Colin, who was pertified in November and practically missed his entire first year, and Justin, who was pertified in the middle of December, caught up with the material they had missed.
There are a few options:
Remedial Lessons
We know there are remedial Potions lessons, arranged by Snape:
“I will expect you at six o’clock on Monday evening, Potter. If
anybody asks, you are taking Remedial Potions. Nobody who has seen
you in my classes could deny you need them.” - Harry Potter and the Order of the Phoenix
Colin and Justin probably took remedial Potions (pure joy for all concerned, I am sure) and the Heads of the other houses, Professors McGonagall, Sprout and Flitwick surely also made arrangements to tutor the students in their subjects. Prefects and other fellow students may have also helped.
Grade Retention
It's also possible they were advised to repeat their missed year, but there's no specific information about it in the books.
Summer Homework
Maybe they also got more summer homework. They couldn't use magic outside of school, but no reason they couldn't study the theory of the material they missed.