Note here that while this answer covers BMI and ASCAP, the general process is the same with other songwriter royalty groups, like PRS.
The easiest way to join ASCAP or BMI is by visiting their respective websites. The entire application process can be handled online - this is true for both songwriters who want to join and for publishers who want to join. Each group has a one-off fee involved in applying.
What they are looking for in an application is someone whose songs have a realistic change of being played in the media or in a public setting at sometime in the near future. If you have just recorded a demo, but you haven't done anything with it yet, then it's probably not the best time to file an application. However, if you have a website and your songs are online, then your application will likely be accepted. If your application is denied for some reason, take heart. It's not an indictment on you or your music, it just means you're not quite ready to join yet. As your career progresses, you'll get a thumbs up from the groups.
Note that BMI and ASCAP are songwriting royalty groups, and so they are only for the songwriter in the group. Musicians need not apply here. Also note that you cannot apply to BMI if you are already an ASCAP member.