How I can run a script when somebody merges branch "test" into "stable" ?
In other words, I want to run a script after the stable branch is updated.
Depends on the purpose of your hook.
You could be running it when changes to stable are published to a reference repository, or when they are being prepared on a developer's local repository. You could be running it before the commit, to be able to prevent it, or after, to only be notified of commits that took place.
Anyway, look at