A grammar school is to expand after an “unanticipated” surge in pupil numbers left it 80 pupils above its current capacity.