ABYC A24 states: Detectors shall be certified by an independent third party to meet the requirements of UL 2034, Single and Multiple Station Carbon Monoxide Detectors and section 72A Carbon Monoxide Alarms for use on Recreational Boats. If you can find one that meets requirements in a hardware or RV store that is fine. They only require them on gas powered boats with accommodation spaces. ABYC doesn't currently require them on boats with diesel engines or generators, but that will change. I recommend them on all diesel boats.
You should install one in each accommodation space (staterooms and saloon). The sensors have a limited service life, usually 5-7 years and the replace by date must be marked on the unit by the manufacturer or the installer. CO has a cumulative effect, replacing the oxygen in your blood. There is about half as much CO in diesel exhaust as in gas exhaust, which means it will kill you half as fast, but you will still be just as dead. Test them regularly.