How far can one go with an app before having to pay for the developer license? We are using the iAd framework, which I know you need the 99$ developer license in order to be served ads. But you also need the 99$ developer license in order to go live in the AppStore. My question is, how far can one go before having to pay this? I.e. can we do the Testflight for beta testing before having to pay that fee? Or by then will we have to have committed the 99?

The reason I ask is because, if the app store ultimately rejects the app you have effectively flushed the cost of the license down the drain.
You'll need to sign your binary before submitting it for review. In order to sign it, you'll need to have a paid developer account.

This also is valid for TestFlight. From Apple's page on TestFlight:


  Apps made available to external testers require a Beta App Review and must comply with the full App Store Review Guidelines before testing can begin. A review is required for new versions of your app that contain significant changes.


Keep in mind that it's not a "license" for one app. There is no real limit on the number of apps you can develop and submit with one developer account.