Open Dynamics 365 and navigate to Settings > Solutions. Once there, double click to expand the Entities tab and open the custom entity for which you wish to create the icon.
Note: Keep your icon ready with 32x32 size and 16x16 in size.
Click the Update Icons button on the top of the screen.
As you can see on the top requires a 16px image and the Entity Forms section requires a 32px image.
Note:For v9 we need to upload the new icon image to all these places
Now create a new web resource in your solution and upload the image: