The diffraction is a physical phenomenon which appears when light goes along some edge. It is well demonstrated on a slit or pinhole.
We as photographers see this effect when ever we close the aperture. Then the aperture acts similar to the pinhole in this article on Wikipedia.
Diffraction in Photography
The light comes into the lens and passes the aperture on its way to the film or sensor. It is either blocked by the aperture or passes through the hole that the aperture forms. That part of the light that passes the edge of the aperture very closely is affected by the diffraction. The smaller the aperture is the larger is the portion of the light that is affected.
When you take a night shot or one of candles or similar small spots of lights in the darkness while you close the aperture to its maximum, then they form little stars. Lots of photographers do like them actually and aim to achieve them.
So can you have those stars and avoid the diffraction although you both depend on closing the aperture?
No, you cannot. Both is actually the same. The stars are just depicting the diffraction. Next to the aperture's blades the light is diffracted either towards the blade or away from it. That is what forms the stars.
Have a look at these stars in detail:
Blur caused by diffraction
The point is that this does not only happens to small light sources. It does happen to each part of the picture. Everything is diffracted a bit with in total just adds some blur to most of the picture.
The image gets more blurry the further the aperture is closed.
So does the image get more clear the more open the aperture is?
Yes and no. Yes if you look at the diffraction only but no if you take the whole lens system into consideration. There are other effects like chromatic aberration which reduce the image quality when aperture is opened to its maximum.
So the more you close the aperture from its greatest opening towards its smallest, the better the image becomes but it gets blurry again when you get into the range of diffraction effects. Naturally somewhere in between must be an aperture level where the image quality is at its best.
I tried finding that aperture level for my Canon EF 100mm 2.8 macro lens with some long aperture bracketing. Have a look at the images and try it yourself with your lenses. My sample shows full aperture steps from 1/2.8 to 1/32. You may want to do 1/2 or 1/3 steps in the interesting range between about 4 and 11 to find the most sexy aperture that your lens has to offer.
On the left you see the full image and on the right you see the lens's sweet spot in the center of the image.
Creating Stars with Filters
If you are out for the little stars but do not want to pay for them by accepting the diffraction then you could create them with star effect filters that you mount on the lens. Marcel Hermann has done so for his image of the Loschwitz Bridge in Dresden.
One problem is that the creation of the stars has some quite similar affect on the image as the diffraction does. Although created differently the effect affects all of the image which will get slightly blurry all over it. Another disadvantage of the stars effect filter is that it may even mirror some lights as all filters do. (See my article about UV filters)
The advantage of using this filter is that its shape is given by making of the filter and not dicated by the shape of the lenses aperture and its direction can be controlled by turning the filter around.