Ages in the Sonic series are inconsistently published, so treat any list as approximate rather than official. Commonly cited figures include:
Sonic – around 15–20 depending on the source
Tails – 8 in early material, often listed as 14 later
Amy Rose – 12
Knuckles – around 16
Shadow – biologically adult, created roughly 50 years before the games
Rouge, Vector, Espio, Big – adults, usually placed between 18 and 25
Cream and Charmy – 6
Silver, Blaze, Jet – teens
Dr. Eggman – late middle age
The variation comes from Japanese and Western manuals disagreeing and from decades of retcons. If you need a number for a specific game, that game's own manual is the only authority worth citing.