at least 20nm to be clear.
It would require conditions of extreme atmospheric clarity and some very high wattage navlights to be visible at 20NM, and your height of eye would need to be substantial (I’m too tired to look in the tables). COLREGS require that masthead lights be visible at 6NM and sidelights at 3NM in clear conditions.