Hi Beck07, yes as the other answers state, by law you definately have to pay it back, the fact that it was their mistake will not make any difference to the courts!
I don't wan't to frighten you and I am not saying this will happen to you, but I read a tale in the newspapers about someone being jailed for keeping money that was being paid to them in error when they knew it was not theirs, I think in this case it was a bank accidentally paying it into the wrong account.
If you cannot afford to repay the full amount immediately,
my advice would be to contact them, be very apologetic and agree a form of repayment that you can afford.
Best of luck
Sue