Finding the number of orbitals on a central atom
According to the question, it is totally not clear that whether you want to know filled orbitals or total orbital (filled + vacant). Well, but after seeing the examples you gave, it can be concluded that you are talking only about filled orbitals. As I'm not clear and assuming that you are only talking about filled orbitals, so if you are talking about total, leave a comment.

As each orbital contains 2 electrons, therefore it is easy to find number of filled orbitals.

The number of filled orbitals in central atom will be equal to the sum of number of bonds and number of lone pairs present on central atom.

Example

As in case of $\ce{BeCl2}$, $\ce{Be}$ makes 2 bonds (both with $\ce{Cl}$) and have no lone pair, therefore,

$\text{No. of filled orbitals} = 2$

Let us take another example of $\ce{NH3}$.

In case of $\ce{NH3}$, $\ce{N}$ makes 3 bonds (each with $\ce{H}$) and have 1 lone pair, therefore,

$\text{No. of filled orbitals} = 4$

Take another example of $\ce{ClF3}$

In this case, the central atom $\ce{Cl}$ makes 3 bonds with $\ce{F}$ by sharing its one electron in each bond and have 2 lone pairs on it. (As $\ce{Cl}$ have 7 electrons, 3 shared in bonding and 4 left = 2 lone pairs.) Therefore,

$\text{No. of filled orbitals} = 5$

Hope, now everything is clear to you!