The way to do this depends on your story format. You should put the name of your story format in the question tags here so we know which one you need help with.
You set your story format using the bottom left menu. It defaults to Harlowe, but I use the SugarCube story format instead.
If you are using SugarCube you can use the <<textbox>> macro to display a textbox that users can type a name into, and it will automatically get filled in with a default value and stored as a story variable. For example:
Enter your name here: <<textbox "$playerName" "Steve" autofocus>>
That will display "Enter your name here:" followed by a textbox that says "Steve", and the "autofocus" means that the cursor will start there so the player can change that default name.
As for showing different dialogs, the Twine Cookbook shows how to use conditional statements for a couple of story formats based on a variable. If there are more than two possible values, and you're using SugarCube, you might want to use the <<switch>> macro instead of using an <<if>> macro.
Hope that helps!