compass disagreements
Boy, have you opened a can of worms here!
Let's start with your sailing location. You will need to determine the amount & direction of the "Variation" in your local sailing area. This is the difference in your area between true north & magnetic north. In this respect the ship's magnetic compass & a hand bearing magnetic compass should agree within a couple degrees assuming there are not large magnetic interferiences nearby (stereo speakers, electric motors, etc.). Your ships compass should have compensating adjustments built into it's base, so if the P.O. have "swung" the compass you may get a difference there.
Now for GPS & electronic compasses. These usually give you true direction as opposed to magnetic north. Therefore you almost always have a difference between a magnetic compass & electronis devices unless the electronic compasses have been compensated via an input to take into account the local variation.
To get a much better explanation I would suggest getting a copy of Chapman's Piloting. They will explain in detail variation & deviation and how to adjust for it. Much more detailed than we have room for here!.
A piece of advice I was given early on in my boating career is that you only disbelieve your magnetic ship's compass when you UNREFUTEABLE evidence that it's wrong. Haveing been offshore in a heavy fog I can tell you it's very easy to get confused.
I hope this will help you out a little. It's a very complex subject & there isn't enough room here to touch on everything but if you have a specific question I would be happy to try to answer it.
Have fun & sail fast
Bud E34 "Escapade"