Even the most basic modern gas fired tankless water heaters designed for exterior installation in cold climates have an electric heater in them to prevent freezing of the water in the core. There may also be a fan to distribute the heat. These would cycle on and off under thermostatic control.
Another possibility is that your tankless water heater is a more advanced model which has an internal water circulation pump to keep the water lines in the house charged with warm water. This would be under thermostatic control and would be cycling on and off and could be used to keep the water heater and the water lines from freezing.
The operation of these circulation pumps is almost certainly programmable. If it does not freeze where you are, you might want to change the program so that the circulation pump is inactive during the night.
The purpose of these circulation pumps is to reduce the wait time for hot water at the use points. For this to work there must be a connection between the hot and the cold supply lines at one or more use points. Normally this would be at the most distant use point, such as under a bathroom lavatory or the kitchen sink.