Is it a Shimano? A quick check would be put the chain on the big ring in front and small cog on rear. If your chain is the correct length your derailleur should be vertical, straight up and down. If your chain length isn't the problem and the teeth on your cassette are fine, you should be able to fix the problem with the barrell adjustment screw on your derailleur.
Here's how