In The Great Gatsby, does Tom try to keep his affair with Myrtle a secret?
Generally speaking, Tom does not try to keep his affair with Myrtle a secret. In Chapter One, for instance, Jordan tells Nick that "everybody" knows that Tom has a "woman in New York." She even calls the Buchanan house and this is how Daisy finds out that Tom is having an affair. In the next chapter, Tom takes Nick to meet her and makes no qualms about his secret life.
In contrast, it is the identity of his mistress which Tom tries to keep secret. Tom never tells Daisy or Wilson, for example, that Myrtle is the object of his affection. Moreover, in Chapter Two, he and Myrtle ride in separate train cars on the way to New York. Tom claims that this is to protect the "sensibilities" of any passengers from East Egg but, arguably, he does this because he wants to protect Myrtle from being gossiped about.
That Tom does not try to keep his affair a secret reveals the arrogant side of his character. His only interest lies in pleasing himself, instead of protecting the people around him.
Tom tries to keep the affair with Myrtle a secret from both his spouse and her spouse. We know this because although Daisy seems to know about it, when Myrtle calls, Tom takes the call in another room. Jordan reveals this information to readers when she tells Nick that Tom has a girl.
When Tom takes Nick to "meet [his] girl" they stop at Wilson's garage. Tom talks small talk with Wilson, and when Myrtle comes down the stairs, he waits until he gets Myrtle alone to speak with her about his intentions. Once alone, he encourages Myrtle to go to their apartment in the city. At least Tom and Myrtle are smart enough to ride in separate train cars.
By the time Tom and Myrtle get together on the train, many people of New York see them together knowing either of their spouses. At this point however Tom doesn't care.
Tom's wife seems to know what is going on, but she keeps it from Tom that she knows. Myrtle's husband is completely oblivious and has complete trust in Tom.