This is an interesting question. Several lines of argument are open to us for an answer.
We might say that each man was "too much apart" from his own situation to actually control the events that he needed to control. Each has his own reasons but these lead to a similar social distance between the man and even his most immediate society.
...even before he encounters the Ghost, he has lost the will to involve himself in worldly affairs.
Being intentionally aloof, for both Hamlet and Gatsby, leads to death and defeat. Like Gatbsy, Hamlet prefers to stand aside and think - planning, conniving, worrying.
From this standpoint, Hamlet does not act immediately because he is too preoccupied with analyzing his situation and himself in the broadest terms imaginable.
We might also say that each man placed an irrational emphasis on a sense of honor and that this affinity constitutes a tragic flaw. Hamlet is unable to deny the request of the ghost. He feels honor-bound to carry out the wishes of his dead father (though he knows that this will ruin his mother's life completely and make him into a murderer of sorts as well).
Gatsby, having "taken Daisy" one night, feels honor-bound to fulfill the implicit promise of that evening. To this end, he refuses to leave town after Myrtle's death and waits by the phone until George Wilson comes and shoots him.