I've been getting into Assassin's creed IV lately, playing it ALOT.
But now every once in a while my PC restarts like someone unlplugged it and plugged it back in.
It never does this when im not playing games.
No one can help you without more information - post your system for better results.
Typical causes of what you describe:
*Failing or under sized PSU
*Overheating CPU or GPU
*Bad RAM chip
Could be another hardware issue, but considering it only happens during games it is very likely the items listed above are causing your problem.
my PC is
CPU: AMD A8-6600K with Hyper 212 EVO
GPU: ASUS DC2 GTX 760
MOBO: MSI FM2-A75MA-E35
RAM: Crucial BallistiX 2x4GB kit at 1600mHz
PSU: Corsair CX750M
all in an NZXT H230