If your code is outside a function, you can do it by modifying locals.
my_name = raw_input("Enter a variable name") # Plain input() in Python 3
localVars = local()
localVars[my_name] = 5
If you're inside a function, it can't be done. Python performs various optimizations within functions that rely on it knowing the names of variables in advance - you can't dynamically create variables in a function.
More information here: https://stackoverflow.com/a/8028772/901641