This will depend on your relationship with the person you are doing the work for.
For instance, if you are a contractor and you have not entered into a written contract stating otherwise, you will automatically own the intellectual property in the works created. Even though you will own the intellectual property, there will be an implied licence which means the entity you made the intellectual property for will have the right to use it.
Even as a contractor, the company might ask you to agree to a software development agreement, otherwise known as a contractor agreement, service agreement or developer agreement. These contracts might stipulate that they own any intellectual property you create for them, by assigning intellectual property to them as soon as it is created. Assignment of intellectual property is permanent and gives full ownership rights to the assignee. If IP assignment is not already embedded in a contract, a business might also choose to ask you to agree to an Intellectual Property Assignment Deed, the sole purpose of this deed is to assign the rights of the intellectual property to the business. Usually these contracts and deeds are entered into before any work is created, but may also occur after the work is created.
Another option is for you to license out the intellectual property. You can license it out in a few different ways.  An exclusive licence means the business you created the design for is the only entity that can use this design, and the web designer cannot use it. A non-exclusive licence means anyone with the licence can use the design. Lastly, a sole licence means the web designer and the business the intellectual property was created for are the only two entities allowed to use the design.
Now let’s take another example, and assume you are employed as a web designer by a company. Generally any intellectual property created in the course of employment is automatically assigned to the employer. This means the entity, not you, owns the intellectual property.