Sonic X began in 2003. The series went on to air new episodes for quite a while, continuing its run on Saturday mornings.
If you are looking into its full broadcast history, checking a reliable episode guide is the best way to confirm exactly when new episodes concluded, since scheduling and syndication varied by region over the years.