Design is the discipline of creating a new solution to a problem. You can design anything, from a web site to a stadium, a sales pitch, a recipe, a logo, a social media campaign, or a component for a machine. If the solution did not already exist, you have done design.
Every problem has its own unique requirements. If there is no existing solution to the problem, you have to make one. That’s design. You look at what the thing needs to do, and use your imagination and experience to visualize something that does that.
You know a design is good when it achieves the result it is designed to deliver. The result you aim to achieve may be purely functional, measurable with hard data, or it may be an experience, which it’s less easy to measure.
Graphic design is the creation of new solutions to problems within the medium of visual communication, either in 2D or 3D, on paper or digitally. The output is usually something that can be reproduced in order to deliver its objective many times.
Graphic design output includes logos, web site user interfaces, tattoos, sketches for fashion or industrial design, typefaces, print, animated characters, advertisements, flyers, movie credits, newspaper headlines, and designs for textiles. This is just a small part of what can be designed graphically. What they have in common is output that will be consumed through visual media.
Web design is the creation of a new solution to a problem in the web medium. It includes graphic design, because the output will be consumed through a visual medium. But it goes further than the purely visual. It stretches to incorporate every aspect of a web experience.
For example, choosing the right text contents for a web page is part of web design. This text may be viewed on search engine results, which is part of the user experience. And the position in the rankings of that result is also part of the experience, so I would argue that search engine optimisation is part of web design also.
Designing a web experience may incorporate some or all of the following list of disciplines. Some come under graphic design, others are broader design.