Story points are assigned to user stories as part of the process of creating the user stories. Alternatively, you can also add the story points prior to starting a Sprint (e.g. during the Sprint Planning session).
Want to learn more about Agile? Read this EBOOK, listen to this AUDIOBOOK or enroll in this COURSE