Embedded system, How to define or calculate a time period
The mathematics for EDF schedulability are described at https://en.wikipedia.org/wiki/Earliest_deadline_first_scheduling, and similarly for RMS at https://en.wikipedia.org/wiki/Rate-monotonic_scheduling. It is all rather theoretical and in the real world it is often more empirical.
How can I find out the correct number...
It is not clear what "number" you are referring to, but if you mean how to calculate the "deadline" for a specific task, that is not really what the schedulability test yields. Rather it determines given the maximum-execution time of a task whether or not all tasks will meet their deadlines.
The theoretical models also make a number of assumptions such as periodic tasks and negligible context switch overhead. But event driven systems often have few or no periodic tasks. Meeting response deadlines in the microsecond order does not lend itself to periodic scheduling. In that case you must use both worst case execution time and worst case event rate.