Hi @alaeddine69,
Thank you for getting in touch with us!
It sounds like you want a user to become a registered user or member after a payment has been made for the membership. You will be pleased to know that Paid Memberships Pro does this for you already.
When a user selects a membership level and proceeds to make a payment, Paid Memberships Pro will:
a) Create a WordPress User for you using the details that were collected at checkout
b) Assign the relevant membership level to that newly created user account.
From here on out, the user can now log in to your site using the username and password they chose.
If you need some help with the login process, please see: https://www.paidmembershipspro.com/best-practices-member-log-log/
Hope this helps!