Generally speaking, the frequency of the data is the difference between consecutive time-stamps.
If all is well, that difference will be constant across your time-series; in this case, this difference is the frequency of your data.
In other cases, it might be a bit more complicated - for example, you can have missing data, or data where some timestamps are shifted a bit forward or backward.
In which case, you might want to 'smooth out' those issues, for example by taking the median of such differences (if some samples come a bit too early and some come a bit too late), or the mode (if some samples are missing, meaning that most will come at the right time and some will be too late by an exact multiple of the real frequency).
Python (pandas) Example
Here's an example in Python, using the pandas library:
let's make up a time series with missing values. Its frequency is 5 minutes, but about 5% of the samples are missing (its data is random integers between 1 and 20, and the 1's have been dropped)
import pandas as pd
index = pd.DatetimeIndex(start='2020-01-01 00:00:00', end='2020-04-01 00:00:00', freq='5T')
s = pd.Series(index=index, data=None)
s = s.apply(lambda x: random.randint(1,20))
Now let's look at the time-difference between existing (not dropped) samples:
i.e. the vast majority of samples are really 5 minutes apart, but not all of them.
We'll take the actual frequency by taking the median of those differences:
Timedelta('0 days 00:05:00')