Definition
Let $\mathcal{T}$ be the family of subsets $T$ of $S=\bigcup_{n\geq 1}\mathbb{N}^n$ such that $\sigma \mathord{\upharpoonright} k\in T$ whenever $\sigma\in T$ and $1\leq k\leq \#(\sigma)$. Menbers of $\mathcal{T}$ are often called trees.
For $T\in \mathcal{T}$, set $\partial^0T=T, \partial T=\{ \sigma: \sigma\in S, \exists i\in \mathbb{N}, \sigma^\frown i\in T\}$ and $\partial^\xi T=\partial(\cap_{\mu<\xi}\partial^\xi T)$ for $0<\xi<\omega_1$.
The rank of a tree $T$ is the first ordinal $r(T)<\omega_1$ such that $\partial^{r(T)}T=\partial^{r(T)+1}$.
Question
After making some examples, I expected the rank of a tree to be a natural number or $\omega$. Is this correct?
I am unfamiliar with ordinal numbers and cannot give a proof or a counterexample.
No, the rank of a tree can be an arbitrarily large countable ordinal. A useful construction here is the following: given a well-ordering $\triangleleft$ on a set $X$ of natural numbers, we can form the tree $T_{X,\triangleleft}$ of $\triangleleft$-descending sequences through $X$. The rank of $T_{X,\triangleleft}$ is "more-or-less" (exercise: compute the exact relationship!) the unique ordinal to which $(X,\triangleleft)$ is isomorphic.