When assembling a custom engine, the possibilities to change the combinations of components are endless. With crank shafts ranging from 64mm stroke all the way to a massive 90mm stroke. Most common stroke sizes at the moment range from 69mm to 86mm. With the new cases that are slowly coming out, who knows where we will be in 10 years time???
Then added to the range of stroke lengths, we also have all sorts of conrod sizes, from shorter than stock to longer than stock, different strength materials, different designs, different shapes and so on...
The to add to this equation, we can get pistons with different gudgeon pin heights. These heights are referred to the distance that the pin is from the rings (or the piston crown). Custom pistons are available (if you are getting custom pistons, you should not be reading this...) but the 3 sizes typically available are the "stock" height, "stroker" height and "super long stroke" height
A stock piston looks something like this one

in this picture you can see the piston with the gudgeon pin almost inside the oil scraper ring groove. This is a stroker piston coupled to a 84mm crank and a longer than stock (by 3mm) conrod
I cant find pics of the super long stroke pistons, but those have the gudgeon pins right up inside the oil scraper ring grooves.
From my understanding of how things were designed, the stock height piston is designed to be the same height as a stock piston on a stock crank and stock con-rod when at TDC. Then at some stage, the 82mm crank became popular, so the stroker pistons were developed to allow the piston to stop at the same position when at TDC as if it were a stock engine (assuming this piston is coupled to a 82mm crank and a stock length conrod).
Now as I am sure you can guess, the instant you make a change to any of these lengths, the piston will either protrude from the end of the barrel or be so short that it wont get near to the end of the barrel.
The height between the piston and the top of the barrel is known as the deckheight. The top of the barrel also happens to be the bottom of the cylinder head. So if the piston moves too far up the barrel, it will slam into the head, destroying a large chunk of your bank account. So if this is the case, you have a few options.
1) source new parts that will fit
2) machine down the piston tops
3) move the barrel outwards to clear the piston
Machining the piston can lead to the crown becoming weak, so if you do go this route, try to remove as little as possible. The easiest option is to move the barrel using spacer shims or shim stock cut to size.
I have got these pics from my engine build to demonstrate the deckheight idea
Here you can see the barrel and piston assembly, but the piston is sticking out past the end of the barrel


So I added a 1.5mm barrel shim

I then also added various bits of shim stock that I had cut to size until I ended up with a deckheight of 1.05mm

On a side note, the deckheight does seriously influence the quality of the combustion process. A large deckheight leads to poor mixing of the air fuel mix and a slow burn, which does tend to promote detonation and slightly higher cylinder head temps. A tighter deckheight should improve engine efficiency and cylinder head temps.
The area to aim for is a 1.5mm deckheight or slightly less. Try not to go lower than 1.2mm unless you have top notch equipment inside the engine as things do stretch when at speed and you dont want the piston kissing the valves or the head. I have heard of guys running down to 0.7mm deckheights, but their conrods cost more than I would like to imagine just to reduce the stretch.