the cassette is usually changed much more frequently than the chainrings
generally
the chain is changed most often
but eventually the cassette will wear out too
especially if you go too long between chain changings
chainrings can go years and years if the drivetrain is maintained properly