Test Studio is licensed on a "per machine" basis. You do need some license installed on each machine that is involved with creating, building and running Test Studio tests. The real question is which license best fits the needs of the machines role on question:
- Ultimate Edition
- Function Edition
- Load Edition
- Runtime Edition
For build servers just building the test project the Runtime edition works best. It doesn't allow you to create new tests or modify existing tests but support building on a build/CI server as well as running tests. This edition is significantly cheaper than the first three.
To answer your final question, when a trial expires the software simply ceases to function. Your test projects and files are still intact and will be usable once a purchased license is activated on that machine, or the tests are copied to a machine that has an active license.