The societies created would be completely and utterly dependent on the artifacts of your particular methodology for limiting the mental age of the individuals. It is impossible to say what would happen to society without knowing those details. One of the major things society accomplishes is that it raises the next generation. Some philosophers argue that is the purpose for society. We cannot figure out what society would look like until we understand what other factors affect the "raising" of the next generation. Otherwise, it's like trying to figure out where hockey players will go in a hockey game without considering the puck. Wayne Gretzky is famously quoted, "I never go where the puck is, I go where the puck will be.
In this answer, I will provide three answers, differing in how the 21-year limit is implemented. Two are simple and short. The third is more interesting.
For all three options, the initial effect is the same, because society will be dominated by the sudden inexplicable death of the vast majority of their population, rather than by the longer term aging effects. Fortunately for the third world countries, they will be less brutally affected by this than their first world brethren:
- There are more sustenance farmers in 3rd world areas. This means they will likely be able to grow their own food to survive.
- Their societies are less dependent on knowledge or wisdom that is gathered at an older age for survival. In particular, every farmer knows how to farm reasonably well by the time they're 18.
- They are used to inexplicable things happening. While first world citizens are frightened and wracking their brains for answers as to what happens, the third would nations are less likely to have panic issues.
There will be a tremendous amount of power struggle. All of those in power will have died, and in some places you won't even have anyone alive who remembers what peace felt like. In those areas, dozens of small time warlords will crop up and compete. They may even accidentally annihilate their own culture.
And now for the long term effects. All of these are dominated by society trying to work their way around the newfound limitations of 21-year old minds.
Option 1: No new information can be assimilated into the mind after the 21st birthday besides short-term memory.
Relationships falter at 21 years old, because nobody can remember each other after that. This will be very similar to dealing with Alzheimers or Dementia. Few would live past 25, because the strain of not really knowing what is going on would be so intense.
Nobody would live past 21 by choice. Very quickly the under 21 crowd would figure out the nanobot's rules, and choose to die with honor before the effects of the nanobots can crush them. As a result, there is a very strong desire to go out with a bang. People will be taught to go full-speed ahead at all times, trying to get as big as possible before doing something incredible at the end of their life.
As secondary effects, society would develop around how to support a large number of individuals running without stops. Well defined channels for how to live one's life would form, such as Warrior paths, Scholar paths, Politican paths, and so forth. Each one would accelerate an individual to their maximum potential before letting them go and seeing what they accomplish in the last few years of their life.
Option 2: New book-smarts knowledge (intellect) can be assimilated after the 21st birthday, but no new street-smarts (wisdom) can accrue.
Knowledge is power. We are usually entrusted with knowledge as we show the wisdom that we can use it wisely. Individuals could easily accrue 2-3x more knowledge than they have wisdom to temper. As a result, a large number of individuals would meet their demise by trying to wield more knowledge than they could handle. Consider someone who dedicates their life to the sword, and can gather the knowledge of a 60 year old Katana master, but has the temper of a 21 year old.
Society would quickly learn how this works. There would be a goal to gather as much knowledge as possible, and then become as calm and passive as possible. A common pattern would be for men to join a monastery before the age of 21, learning to cultivate their inner calm. That way, once they hit 21, they could continue to positively affect society without needing to collect more knowledge without end. Like in option 1: there would be a preference for suicide over losing control of one's self after the age of 21. Unlike option 1, this would probably occur closer to 30 or 40, when one's inner calm is simply no longer enough.
Society would quickly form around religion. Children would have to be taught the wisdom of completing the bright portion of their lives before 21, and not waiting until 21 to start the dimmer portion of quiet contemplation. A 21 year old who never meditated will find they can never meditate, and will have troubles like in option 1. Religion is the easiest way to generate these "bigger than yourself" behaviors.
Option 3: The nanobots seek to preserve the 21-year limit with immaculate precision. Whenever someone learns something new after their 21st birthday, the nanomachines re-simulate the last 21 years, and find a way to create a consistent world where it appears the individual was born exactly 21 years ago, rather than his or her actual birth date. This could involve rewriting the memories of other individuals, as they would have interacted with eachother in new ways. New relationships would be struck, new complications would occur. Regardless, when the nanobots were done, a consistent worldview of all people will create the illusion that nobody was born more than 21 years ago.
This one is interesting because it creates an interesting dynamic for the living. There will be a glut of individuals apparently born 21 years ago, and a spattering of younglings. This will create a very strong bipolar culture. This could take the form of benevolent older siblings trying to bring their younger siblings up to the wave of 21 year olds. It could also take a repressive form of older siblings trying to make sure they are not crowded out by the new ones growing up.
Likely cultures would flicker back and forth between these extremes. Society would form to mitigate the flickering, to try to find balance. There would be attempts at population control to ensure a "correct" number of 21-year olds. Young individuals would quickly be taught to be cute and nonthreatening, in order to survive to the age of 21.
Interesting secondary effects would form around the nanobot's attempts to rebuild histories to be consistent. There would be a clear flavor to it, nanobot's preferences towards easy ways to make things consistent. Every now and then, nanobots might make a mistake. Eventually culture would realize that it is embedded in this fabric.
Lovers would be highly passionate in this world for two reasons. First, each embrace may be their last as anyone's learning may suddenly overwrite their entire relationship to maintain consistency. Second, separating a pair of closely entwined lovers would be harder for the nanobots. They would prefer to leave the lovers intact, because its easier than untangling them.
Physical marks of affection would gain popularity. It is much easier for nanobots to rewrite memories than it is to undo a physical marking. A common ritual might be to etch a line in one's wedding ring every year a couple is together. A couple may reminisce, looking back at a wedding ring whose marks shows they've been together from the age of 15 to well into their 30s, even though both of them swear its only been 7 years. Love would truly conquer all.