When it comes to harvesting squash seeds, you must wait until the fruit is ripe and ready for eating. To be on the safe side you can leave them indoors on a warm windowsill for day or two to allow the seeds to develop further. Once you are happy that the squash is ready, cut it open, scoop the seeds out into a sieve and rinse them under a running cold tap. This will wash off most of the fibrous, jelly like coating which covers them – this is there to prevent germination while they are still in the fruit. Once clear of the fibrous jelly, spread the seeds out onto a china plate to dry – then after a couple of days turn them over. It is important to allow them to dry out thoroughly although this can a few weeks. This is important because you do not want the seed to rot while they are in storage.
Once properly dry, store in an air tight container and place in a cool dark place where they can remain viable for up to five years.
Source: The Garden of Eaden