Cortana is a default feature now, so it is enabled on Windows 10 Lock screen provided you have not disabled the feature completely. When your system is on lock screen (Win+L) the Cortana feature is enabled so it can answer your questions as in the normal mode. You need not unlock the device to enjoy the Cortana experience. However if you do not wish to have the feature enabled on lock screen mode or want to add the feature here are the steps to follow:
Click on Cortana feature present on the taskbar to open it. Or you can press ‘Win + S’ on the keyboard or just open the feature by saying ‘Hey Cortana’ if this is enabled.
Once you have opened Cortana, choose ‘Settings’ button by clicking on it.
You will find the option, ‘Use Cortana even when my device is locked’ on the settings window. Turn the feature off, if it is enabled. If you want to enable the feature, use the steps below.
In the 'Settings' window, check the box for ‘Let Cortana access my calendar, email, Power BI data and messages when my device is locked’, if you want the feature.
Note: This may cause a security breach if individuals with malicious intent gain access to your computer in your absence.
To launch 'Cortana' feature from Lock Screen using voice command, enable ‘Hey Cortana’.
The above steps will help you to enable or disable Cortana access when your computer is in lock screen mode.