If you drove the car the engine came from for a decent few miles & it was OK, and a compression test was ok, then you could just change the belts, water pump and Plugs etc.
If you are going to go as far as head gaskets, then you may as well go for a full rebuild, with new bearings gaskets, rings skimmed head honed liners, ground valves etc...
or as an intermediate just do the heads....

Myself I would always do the full rebuild unless its a very low milage engine.....