Its a change in the core code for a token or currency. The most recent example for the upcoming Segwit 2x hardfork, which is changing the rules of Bitcoin's current code, in this case, increasing the block size from 1mb to 2mb which requires a hard fork. A soft fork is tightening the rules where existing users don't have to take action if they choose not to, but it allows for rule restrictions and opposed to rule changes. A good example of a soft fork was when Bitcoin on Aug 1st implemented Segwit, which is where Bitcoin Cash devs decided to hardfork the code to create a bitcoin clone with 8mb blocks.
A good explanation of the difference between hard and softforks can be found here from Andreas: https://youtu.be/rpeceXY1QBM?t=9m38s