Hetzner has both monthly and hourly billing options. It bills you either for the hourly rate multiplied by the number of hours you use your server or the monthly price cap, whichever amount is lower.
For hourly billing, It’s important to note that the host bills you for a full hour even if you utilize your server for only a few minutes.