The chain is one of the consumables on a bike and changing it regularly, will contribute to keeping the cassette(More expensive) and chainring from wearing prematurely.
If you ride it to death, till it is so worn it slips, when you do replace itr, you will find a new chain slips too. This is because a worn chain really wears the cogs on a cassette, so in the end you have to replace both the chain and the rear cassette, which is 3x plus the outlay.
Get a chain checker, and when it indicated that the chain has 'Stretched'* you are better replacing it.
*Chains dont really stretch, its just a term, but the reality is the pivot bushings wear( the little roller bits between the links) and the chain becomes loose between the cogs and the chainring.
As a consumable bit, you dont need to spend loads, or go XTR or anything.
Because I change mine regularly, I pick something at the £10-£12 mark.
Just remember to lube it, and to wipe that lube off after lubing it- I know that sounds daft, but its only the rollers(bit between the links) that needs to have lube on it. If the whole chain is oily or greasy, it picks up dirt and grime which acts as a grinding paste, effectively prematurely wearing out the drive train components.