Giffgaff publishes its rules in section 13.3 of https://giffgaff.com/terms
Roughly speaking, a sim is considered out of use and deactivated if it has not made an outgoing call or text or used data for 6 months without buying a topup or goodybag.
Once deactivated, the sim remains out of service for a further 6 months before joining the recycling pool. A number will therefore not be issued to somebody else until it has been out of service (by giffgaff's definition) for a year.
It's theoretically possible therefore for the number to be reallocated 6 months after it last received an incoming call or text, though I seem to remember giffgaff saying that it continues to monitor for continued incoming calls after deactivation and will extend the reallocation time if it seems that calls are still being attempted to the number.
That's because if a PAYG phone number is not being used, the mobile operator can suspend the service and recycle the number. Mobile companies do this to ensure that the numbers they have are being used efficiently.
The length of time that a mobile provider deems a phone inactive varies by provider - for some it can be as little as 70 days, while others wait six months or longer. this from the Ofcom website dont know if its what giffgaff does.
@allan1954 giffgaff say this:
Our rights to bar or disconnect your SIM Card
13.3. Your SIM Card will be disconnected unless, at least once every six months, your Account is used to:
13.4. If your SIM Card is disconnected, you will lose any remaining credit or Bundle balance on your Account. giffgaff recycles numbers and we will not be able to reconnect once a number is disconnected and recycled. giffgaff may reconnect you if any disconnection was due to our negligence.
However that is not the whole story.
When new sims are activated, members are allocated a mobile number which they may discard immediately or months/years later. Either by porting from another network or by choosing to change another number.
In these cases the number will be available for recycling exactly six months after disconnection.