how to create a Pop up dialog and link the property to an object
There are a few things to know, some of which are Python specific.

Firstly, text probably won't exist anymore by the time you call execute() because text is merely a local variable, not a class member. To make it a class member, simply declare it as self.text = bpy.props.StringProperty(name="Name", default=""). If you're familiar with C++ or C#, self is almost exactly the same as this.

Secondly, you probably want that declaration in a constructor for that class. The Python constructor is __init__(self) (it has two underscores before 'init' and two underscores after) which you declare the same as any other class method. Put code there that you want to run when an instance of the class is created, just like any other constructor.

Thirdly, I'm assuming that when you call bpy.props.StringProperty(name="Name", default="") it returns the text that gets typed into the dialog. If so, it should be as simple as bpy.data.objects['Cube'].name = self.text