The first is the Federal Wire Act of 1961. However, there are two pieces of legislation you need to be aware of. There were a few attempts to change this, but none of them went anywhere.
On a federal level, online gambling is perfectly legal, just like offline gambling. Decades of legal conundrums left their mark, and when you also consider that states also have a say in the matter it becomes clear just how much of a mess it all is.
A question like “is online gambling legal in the US?” seems simple enough, but the answer is fairly complicated.