It Depends.
Yep, really. How long does it take to wear out a car? A drill press? A washing machine?
You need to give us a more specific question.
"Worn out" means
what to
you? Gradually increasing group sizes at the range to the point where it's going downhill consistently? Or shot out until it's a smoothbore?
In very broad terms, you will probably never live to see the day when the groups double to what they were when the barrel was new.
Modern barrels (like for .223, they can't be, say, 70 years old....) are made of pretty good steel compared to what they used back in the Civil War. If you bought a bolt action .223 and fired, say, a thousand rounds a year (which is a LOT unless you're a big time prairie dog shooter or into matches) it would still take you years of use before you needed to replace it. IF the bore has been properly cared for, and IF you aren't shooting bullets made out of abrasive grit, the barrel will likely outlive you and your heirs.
Back when varmint rifles and some other hot numbers like the .264 Magnum, 220 Swift were brand new, a lot of the barrels wore out sort of quickly because people were stuffing them with really hot ammo, shooting lots of it, and the barrels weren't always made of the best steel. Some of them developed a bit of erosion and couldn't hold their groups so well after shooting industrial quantities of hot ammo.
Bolt actions don't burn out like autos that get overheated from dumping one 30 round mag after the other until the barrel's too hot to touch. .223 isn't hot enough to quickly erode a barrel as something that launches a bullet past 4000 feet per second.
But, hey, be a bit more specific, and we can be, too then. Okay?