Is is correct to say
How many times has Tom been married?
or we have to say
How many times has Tom gotten married?
Both questions are grammatically valid, but they convey different nuances. Also note that gotten is primarily AmE (and at least some Brits would consider the BrE equivalent got to be "colloquial").
For most contexts OP's first version (have) is "normal, standard". It'll be understood as How many times has Tom been in a married state? (separated by periods during which he wasn't married).
By contrast, OP's second version will be understood as How many times has Tom been through a marriage ceremony? But partly because it's a relatively unusual thing to ask, it will usually carry the implication that the speaker not only expects the answer to be [considerably] more than once - he also thinks the number of times Tom has been married is "unusually" high.
That's to say the gotten version is almost a rhetorical question. There's quite a strong implication that the speaker doesn't necessarily care exactly how often Tom has undergone the process - to some extent he's simply announcing that the expected answer is Tom has been married many times.
Has gotten married
in English usually refers to the start point of marriage, that is, the wedding. Tom has gotten married
three times focuses on his three weddings.
Has been married
focuses on the length of time for each marriage.
The difference is very subtle, though, so either is fine and mean almost exactly the same thing.