I finished my novel and realised that I never mentioned my main character's age. In chapter two I said that she in in her twenties, but that's the only mention of her age. I know that she is twenty-three, should I state this in my novel, or is it okay to leave her age vague?
There are a lot of things you don't mention in your story. You don't mention how many times a day your MC uses the toilet. You don't mention how many beauty marks she has on her body. You probably don't mention the colour of her t-shirt.
You only mention the things that are important.
If a character is a child, their age is important - it affects the whole story. A child of six is not a child of ten - there's a significantly different level of maturity there. If your character is elderly, on the other hand, it is enough to imply: white hair and dragging footsteps convey a picture much stronger than a mere statement of "70 years old" or "90 years old". In that case, age would only be important if reference is made to a historic even the character has been affected by.
In your case, as @wetcitcuit states, "in her twenties" gives the reader enough of a picture. Unless the specific age is a plot point, it's unnecessary.
There is nothing at all that you "need to mention". Not the character's age, not their appearance - nothing. Any detail you give is because it is somehow important to the story. If it is in no way important, it doesn't set a mood, it doesn't do anything - throw it away.
(Note regarding setting a mood: stating a character is "in her twenties", "has just turned twenty-three", or "is twenty three years, four months and twelve days old" all create a slightly different image in your mind.)
Yes, it is fine to leave a character's age vague. If your story includes tales from the past, historical events readers would know, or scenes of interactions with other characters from years ago (like her parents or siblings or friends), then you should keep track of a timeline for each character, how old they were and where they were, so you don't make the mistake of having a fifteen year old renting her first apartment or buying a used car without anybody thinking this unusual. But that is just keeping your story straight.
I often leave character's ages indeterminate, some could be pretty much anywhere between 50 and near retirement; they are just "older".
And the age of my MC can be vague too, especially if she is an adult and done with school. Exact age becomes more important for pre-schoolers and non-adults when they are (mostly) segregated by age into classes, and how old they are is a significant part of their psyche. To a lesser extent for the ages of consent, driving, tobacco and alcohol use, entering into contracts and voting. Once those "milestones" are behind them, their exact age is increasingly irrelevant, and categories work. College age, young, middle-aged, etc.
No, if you're describing them then you may wish to mention how old they look but the actual age of characters doesn't matter much. Unless you make it a specific plot point, or there's something odd going on, like a difference between the characters' apparent age and actual age that needs to be noted and/or exampled, I'd leave it alone entirely.
I don’t really believe that the specific age matters. “twenty’s” is helpful though as a general age can help us visualize the character better but unless being exactly 23 is important for the story (she probably just got a BA if she's following a traditional schooling path so she would be just out of school or fresh to Grad School), I don’t think you really ever need to tell us that she’s 23. But, if you really want to, you could just change the fact that she’s in her twenty’s in chapter two to the fact that she’s 23. Although it’s not necessary, it appears as if you have a very specific view of who this person is so you might want to note she is actually 23.
In my opinion, leave out "in her twenties" as a direct description, under the "show, don't tell" guideline. That being said, it would be make sense to have another character notice that she looks like she's in her twenties, or maybe asking a third character how old she is, etc.
Almost every Animorphs book opens with the first person narrator explicitly saying that their only Personal Identifying Information they would give the reader was their first name and until the final book, they were identified vaguely as teenagers, but not yet of driving age (between 13-16) and were all in the same unidentified grade year. We only learn two character's ages in the course of the book: Jake and Ax. Jake only gives his age up in the final book as the story is almost over and the reason for the anonimity no longer serves a point. Ax is odder as he is an alien character and it is stated that his planet has a much longer revolution around its sun thus he technically is only 2 years old, but is of the same maturity as the core cast. At various points in the series, several characters try to explain this by saying that Ax is roughly 14 years old and that one of his years is about 7 of Earth's years, but that Ax uses his own years when he is giving his age. At no point is an direct conversion given and Ax is never explicitly said to be older or younger than the cast but is generally around their age. This may have stemmed for a running gag of Ax being ridiculously precise in exactly whose measurements he is giving and it comes to a certain point that it's clear Ax is doing this for his own amusement but the typical exchange is Ax giving a time limit as "2 of your [Earth] hours" to which one of the kid will point out they are all on Earth and making the distinction isn't needed. It didn't help that his species has a natural sense of time, and Ax is frequently used as an improve stop watch for not missing deadlines.