That depends. If you are a United States citizen and your vessel departs from and returns to a U.S. port without stopping at a foreign port then you do not need a visa. However, if your ship does make stops at foreign ports or if you are not a U.S. citizen then you may need a visa.
This article is intended to be helpful and informative. But even common legal matters can become complex and stressful. A qualified maritime lawyer can address your particular legal needs, explain the law, and represent you in court. Take the first step now and contact a local maritime attorney to discuss your specific legal situation.