The legislation is Section 84 of the Local Government Act 1972:
"A person elected to any office under this Act may at any time resign his office by written notice delivered—
(a) except in a case falling within paragraph (b), (c) or (d) below, to the proper officer of the council;
(b) in the case of a person elected to a corporate office in a London borough, to the proper officer of the borough;
(c) in the case of a parish or community councillor, to the chairman of the parish or community council;
(d) in the case of a chairman of a parish or community council or of a parish meeting, to the council or the meeting, as the case may be;
and his resignation shall take effect upon the receipt of the notice by the person or body to whom it is required to be delivered."
So, for an ordinary member of a parish or town council (c), the resignation must be to the Chair and takes effect immediately upon receipt by the Chair.