Knurling is a process where a cross-hatch stamp is pushed into metal. By doing this, the metal is compressed in some areas and raised in others. Here is a picture of a piston with a knurled portion in the side skirt:
The main part of the piston (as in the picture) which gets knurled is the skirt. The reason someone would knurl a piston is one of two reasons.
First, if they want the piston skirt to hold more oil while running. This can provide better lubrication to the cylinder walls and with the piston skirt.
Second, and is more often the reason, people will have old pistons with worn skirts knurled to take up the slack where the worn part of the piston is at. This allows the piston to fit in the cylinder better than it would otherwise. This is only done during a rebuild where the engine builder is trying to skimp on parts. Since there is relatively little surface area on the piston skirt where the knurling is done which will actually touch the cylinder wall, this area will wear away fairly quickly (in the grand scheme of things).
Knurling pistons is an "old school" technique which I don't think is used much in the modern era. Piston manufacturers are able to produce quality pistons at a cheap price so affording new pistons to replace old ones is a lot easier to accomplish. This is doubly so considering getting old pistons knurled costs you money ... the difference between new pistons and knurling is not that great.
Besides decorative knurling, you can also find knurling done to valve guides to get a worn guide back into spec. This too, has ran its course and has fallen out of favor. One of the possible side effects of knurling your valve guides is if it's not done just right, can make your valve guide act like an oil pump and actually push excess oil into the cylinder. The guide also wears out rather quickly for the same reasons I talked about for the piston. Besides, you can get a valve guide insert done for a relatively cheap price. Inserts work far better than knurling, last longer, and there's no risk of making an oil pump out of your work. It's also much cheaper than having a new valve guide put into your engine.