When choosing a replacement glass for an acrylic boat window, consider that acrylic windows expand and shrink a lot when the temperature outside changes, so account for that change when calculating the size of a new window. Don't use screws to secure the window in place, as they don't allow the window to change its size.
The best way to attach the window is by using an adhesive; however, it is useful to screw the window to the boat when it is first attached and also remove the screws once the adhesive sets. Place the window on its intended location to determine its exact position before applying adhesive to the glass. Mark its position in several places, and mark where screws need insertion.
Place a piece of wood under the acrylic when drilling holes in it to prevent the material from cracking. Clean the surface where the windows attach with rubbing alcohol before attaching the window. It may be useful to apply a layer of primer to the surface of the boat and to the window before covering them with adhesive. Make sure to cover the area around with tape, so that the primer doesn't get on other surfaces of the boat. Apply the caulking in the middle of the primer strip using a caulking gun.