In order to create a stack you have to instantiate an object for that stack. When you do, you pass the stack name as a parameter. Example in Python:
class MyStackClass:
(...)
# You have to have an app
app = core.App()
# Here's the stack
MyStack = MyStackClass(app, "StackName")
Other than that, see the docs:
The physical names of the AWS CloudFormation stacks are automatically determined by the AWS CDK based on the stack's construct path in the tree. By default, a stack's name is derived from the construct ID of the Stack object, but you can specify an explicit name using the stackName prop, as follows.
new MyStack(this, 'not:a:stack:name', { stackName: 'this-is-stack-name' });