The Electric Boat company has been building submarines since 1899 and built subs for the US Navy in both World Wars. The name stems from the fact that they always have been electrically powered when underwater and in the navy’s inscrutable wisdom, they don’t deserve to be called “a ship,” ergo they’re just boats.
They only became General Dynamics Electric Boat after WWII. They built the Nautilus (the world’s first nukular-powered pigboat) and since the early 1970s have been one of only to companies that build subs for the US.
US Navy submarines are called boats because the original submarines were launched from another ship and were in fact boats. As submarines got larger the traditional name stuck.
Other navies in the world sometimes refer to their submarines as ships.