Lighthouses are painted differently to help identification of them by the mariner during the day. For example, a lighthouse may be painted all white if its surroundings/background is dark, such as fields or woodland. This will help it stand out from its background. The red and white stripes help the mariner identify the lighthouse if the lighthouse is up against a white background, such as cliffs or rocks.
The height of a lighthouse takes into account the curvature of the earth, so the higher light above MHW (mean high water), the further away it can be seen at sea. But the light should not be so high up that local sailors will not see it. It is possible that a sailor sitting a mile or so out at sea may not see the light if the beam is too high. Hence, you will frequently get shorter lighthouses on the top of cliffs and taller lighthouses built nearer the water surface.
The actual shape of the lighthouse often depended upon the whim of the individual designer, which is why there are some that look like traditional lighthouses whereas others look like castles.
Additionally lighthouses in fairly close proximity to each other have different flash patterns (or characteristics) to allow the mariner to visually identify their location as well as relying on their technical equipment on board. Some lighthouses in different geographical areas (e.g. east and west coast) share the same flash patterns.