How old were Fred and George when they left Hogwarts, and what year were they in? I’ve been struggling to find out this answer!
Fred and George left Hogwarts in their 7th year. We know that at the start of the 5th book, they were 17 years old as they were allowed to do magic outside out Hogwarts.
With two loud cracks, Fred and George, Ron’s elder twin brothers, had materialized out of thin air in the middle of the room. Pigwidgeon twittered more wildly than ever and zoomed off to join Hedwig on top of the wardrobe. “Stop doing that!” Hermione said weakly to the twins, who were as vividly red-haired as Ron, though stockier and slightly shorter. “Hello, Harry,” said George, beaming at him. “We thought we heard your dulcet tones.” “You don’t want to bottle up your anger like that, Harry, let it all out,” said Fred, also beaming. “There might be a couple of people fifty miles away who didn’t hear you.” “You two passed your Apparation tests, then?” asked Harry grumpily.
Harry Potter and the Order of the Phoenix, Chapter 4: Number 12 Grimmauld Place, Page 68
Now, if they left Hogwarts after April 1st, then they would be 18, but I don't think its ever explicitly stated what month they left
They were 18, and in their seventh year.
At the start of Goblet of Fire, when the twins get back to the Burrow after giving Dudley Ton-Tongue Toffee, their mother lays into them and Harry asks Ron what is going on. Ron replies that the twins "didn't get as many O.W.L.s as she expected".
It therefore follows that those tests are what students take at age 15. If they took O.W.L.s in Harry's third year, that would put them two years ahead of him.
Seeing as they leave in Order of the Phoenix (book five) they had to have been in year seven at Hogwarts.
To start year seven, you must be 17, or you wouldn't have been 11 to start year one.
Their date of departure and their birthday (April 1st) suggests that they had already turned 18 at that point.
In Chapter Twelve of Goblet of Fire we find the following occurring when the Triwizard Tournament is announced on the first day of school:
“They can’t do that!” said George Weasley, who had not joined the crowd moving toward the door, but was standing up and glaring at Dumbledore. “We’re seventeen in April, why can’t we have a shot?”
In Chapter Thirty of Order of the Phoenix, during the time period immediately following Fred and George’s departure, we have the following statement:
The problem was that with just under a month to go until the exams and every free moment devoted to studying, his mind seemed saturated with information when he went to bed so that he found it very difficult to get to sleep at all.
As I established in this answer, the exams began in early June. Thus, Fred and George left school in May, which would have been shortly after their eighteenth birthday in April.
In Chapter Twelve of Order of the Phoenix they describe that year as their seventh and last year (my emphasis):
“We seriously debated whether we were going to bother coming back for our seventh year,” said George brightly, “now that we’ve got —”
He broke off at a warning look from Harry, who knew George had been about to mention the Triwizard winnings he had given them. “— now that we’ve got our O.W.L.s,” George said hastily. “I mean, do we really need N.E.W.T.s? But we didn’t think Mum could take us leaving school early, not on top of Percy turning out to be the world’s biggest prat.”
“We’re not going to waste our last year here, though,” said Fred, looking affectionately around at the Great Hall.
The twins were 17 at the beginning of book 5 because we can see them (or read that they) apparate inside 12 Grimmauld Place and Molly gets agitated that:
pop “OH! Just because you are allowed to use magic now does NOT mean that you can whip your wands out for everything!”
This means that they are no longer underage. Many websites have stated that Fred and George were born on April 1st which is quite fitting for their prankster and jokey nature!
The day that the O.W.L examination was disrupted was sometime after the Easter holidays so Fred and George were already 18 when they left school.
This website says that Fred and George were 2 years older than Ron and since Ron was in year 5, the twins were in year 7.
I hope that this was clear enough and helped answer your question. 🙂