If the overpayment was your fault, you'll have to pay it all back. If you're prosecuted for benefit fraud you could be fined or get a prison sentence, as well as having to repay the money. You may be committing benefit fraud if you know you've been overpaid but don't do anything about it or deliberately fail to report a change in your personal circumstances.
It will also tell you if you have to pay the money back. The reason and period of your overpayment will be explained on your overpayment letter or notification on your Universal Credit account.