Others have said this already, but there can sometimes be benefit to having another person confirming: each examinations board has a complaints system. That complaints system should be available in writing for you to review (should be online - most exam boards have their own websites) but if you have any difficulty then, again in writing, submit a request to the school/organisation that held the examination and say you urgently need the complaint information for the examination board and also for the company that provided the invigilators. Then submit a complaint, in writing, immediately: try to focus on objective statements - so information about the exam, information about when your child was told the exam ended. Then give as much information about the exchange between the child and the invigilator(s) as possible: who the invigilator was, whether there were other invigilators in the room, and what the invigilator said when they interacted with your child. Frankly an invigilator shouldn't be talking to your child at all unless the child has put up their hand, or there is a problem. Asking a child if they have finished is absurd - if a child has 3 hours for a test, then they have 3 hours.
Your complaint should also contain your expectations for what the exam board should do next: if you aren't sure what the options are then demand the exam board reply to you in X number of days and provide you with the options available to your child with respect to their examination and also with how to escalate the complaint if you feel unhappy with the exam board's response. You likely won't be the first person to have an issue with how the organisation that ran the examination in question did their job.
Now: Does your child have other imminent exams they are taking? If so I would urge you to write a letter that the child can take with them to each examination. That way, if anyone tries to cut their time short again your child has a copy of the letter to give to the invigilator from you in which you tell that invigilator that you expect your child to be given the full time allotted to them. If possible include whatever citations from the Exam Board's rules/requirements you can find that support you (it should be blatantly obvious but hey). And tell your child that if the invigilators tell them they can't have all their time that you give your child permission to tell the invigilator that you need to speak to the Headteacher (assuming they are in school for the exams) immediately and that they need to contact you immediately (and any other caregivers your child may have) so they can also be in that meeting with the Headteacher.
Here's some thoughts for anyone who doesn't understand why this matters: Children who have been taught proper exam technique know that to manage time effectively that if get stuck on one they should flag it and come back to it (in the case of a multiple choice just provide any answer - you don't get penalised for a wrong one!!). Then, if and when they have more time at the end to think about the "flagged" questions, they can use the "extra" time to ponder the "best" answer. As such it's common for children to have "finished" reading the exam questions, but to not actually be done making a decision about what "best" answer to give if they aren't completely sure about certain questions. Having time at the end to go back and ponder the more difficult questions (again assuming they are multiple choice ones for example) gives the child the time to ponder the question more thoroughly, and to narrow down the particular potential answers - so at the very least they aren't guessing between all 5 answers, but are picking between, say, 2 potential correct answers. They may still not know what the correct answer is, but if they've narrowed it down to two they think may be correct then (assuming they are correct) a guess at that point is 50/50 - which is far better odds of a correct answer than if they'd just selected one of the 5 answers as part of their "come back to it later" approach.
This underscores why it is so important for children to have all the time allotted to them to contemplate their exam answers - even if they "finish" early they can go back and refine their answers, re-read the exam questions and perhaps catch a silly mistake or assumption they may have made etc etc.