What is the maximum number of nested functions in PIC16F628A?
The datasheet says you have a 8 level deep hardware stack.

That means you can push the registers onto the stack no more than 8 times before the oldest one drops off the end.

Assuming main() is called as a function (which is dependent on how crt0 is written for your compiler), that takes one slot, that leaves you with 7 slots. Not that, under normal circumstances, you really care if that one drops off the end or not, since you shouldn't be returning from main().

One slot should be reserved for interrupts, so you get 6 slots.

Don't forget that library functions, like tan(), sprintf(), atoi(), etc are all functions as well, so using anything like that will use a slot. That leaves 5 slots.

There's always a chance that a library function may call another function, so save at least one for that - that leaves 4 slots available.

So really you don't want to be nesting more than 3 or 4 levels deep to be on the safe side.  So keep your program nice and flat and you will be OK.

Making smaller utility functions "inline" will decrease your stack usage (and the compiler may do that for you automatically sometimes), but will increase your flash usage.