Seriously, I could give you a number but I have no idea what type pool you have, how you plan on constructing the deck, where you live, how high the pool is, etc. Give us a little more info and we can make an informed recommendation.
its a 24' agp im in lansdale,pa im thinking a safe number just for settling etc.. the deck will be attached to the wall of house and span about 16ft out to pool with footers cemented into the ground.
Being in the great white north, you'll want to be able to get a good seal when you cover for the winter. That will be difficult if you take the deck over the pool rail. I went about 2" under the rail so the deck goes up under the rail and I wish I had gone further. 6" under would be about right.
You can install tie downs for the winter along the edge and then remove them in spring.
I pull string in between the deck boards to a hook below. Pool covers stays in place with high winds.
In the picture, the deck boards are new. Once they dry out, a gap of about 1/8" opens up and then you can pull string up from below and attach to the pool cover.
If you live in an area with HARD freeze you do not ever want to have your deck actually touching the pool - either under, up against or on top - a gap is necessary for winter frost heave - even in areas that may not have had it before, with odd winters things change. Even if the deck doesn't move, there is always a possibility of the pool moving and it most certainly will be damaged then. Many people leave a suitable gap above, below or next to their pool. The gap also helps a LOT when you must change a liner or fix a wall or something.
Your situation depends on a lot of different factors.
Since you are fastening your deck to the house and using footings at the outer end of your deck, your deck will be permanently mounted and no heaving will occur.
HOWEVER, your pool WILL heave and this is where your soil type and drainage around your pool comes into play because it has a big effect on how much your pool will heave over the winter.
Great drainage with soil that does not retain water will mean you will only get a little heaving, however, soil that saturates and holds water easily and does not drain off well will heave a lot more in the winter.
My place has the second type of soil - clay, plus - we are in a low lying area so it saturates often - and for me to do the setup you are planning would mean I need to leave at least 3 inches between the deck and top rail, any less and I'll crush my wall when it gets pushed up into the permanent deck structure.
If I had great drainage and soil to accommodate, I could probably get away with an inch, although that is just a little too close for comfort and I would be tempted to go with 1.5 to 2".
If you leave the deck free floating, you can get really close to the top rail since both structures will lift about the same, however, you cannot fasten the deck to your house then or your house wall will incur damage due to the deck twisting at the fastened end.