According to representatives from both Apple and Google, they have stated that they plan to eventually shut the feature down once the pandemic has passed, although they note that this might be done on a region-by-region basis, presumably depending on whether or not a particular region has been declared to be free of the virus or if levels are low enough where the feature may no longer be required.
How exactly this might be determined is unclear, but engineers for both companies do state that the APIs were not intended to be maintained indefinitely. At this point in time, no one knows for sure how long this pandemic is supposed to last. This is because at the moment, there is no known cure or vaccine for the coronavirus.
While companies are racing to develop a vaccine, many are still undergoing the trial phase which means that they are not ready for public consumption. It was previously estimated that it would take about 12-18 months before a vaccine might be ready.