In Peter Pan by J M Barrie, the protagonist never ages; this is a literary technique used in books such as The Famous Five where the characters experience time but do not age or experience more time than possible within an age (i.e. more school holidays than are possible in a year). What is this technique of not aging the characters called?
The technique is called "perpetual childhood." It is often used in conjunction with another technique called a "floating timline."
A floating timeline allows authors and writers to not age a character despite real world events and time passing. A writer could use perpetual childhood without a floating timeline. That's basically what the Hardy Boys books do. Frank and Joe Hardy do not age no matter which novel you are reading. The advantage to using a floating timeline alongside perpetual childhood is that a writer can introduce real world technology as it develops. Comics do this all the time. Take Spiderman for example. He first appeared in the 1960s. Peter Parker was a teenager then and is still a teenager in the new movies. But in the new movies he uses simple technology like cell phones which didn't exist when he was first introduced. So that's a case of a floating timeline being used with perpetual childhood.
The only other way to not age a character despite real world time passing is to use immortality. Tuck Everlasting uses that trope, as does the Twilight series.