In apps such as WhatsApp, Textme, etc., they generate phone numbers for their users. My question is how do they create these phone numbers for their app?
WhatsApp actually uses your phone number that you already own similar to how your email account uses a username. This is their take on a login and accounting system.
As far as services like TextMe, Google Voice etc. The Provided would have to purchase a list of phone numbers and establish themselves as a VoIP provider and maintain a PBX like system to send out calls. Many services allow you to port your existing number to them as well. Text Messages work in a similar fashion but are actually sent as emails.
But going back to your original question, they would offer the user a list of numbers that they already own or assign them an unused one at random.