Sounds like a 3rd party app.
The car sleeps when it feels like it. There is no way to put it to sleep. It may stay awake to download a firmware update, upload data to Tesla, monitor the car, or some other mysterious reason.
However, you can keep it from sleeping by using certain features or bugging it with data-seeking pings from 3rd party apps.
TeslaFi tries to allow sleep by suspending data collection for a few minutes. Apps can check on sleep status without waking the car, so once the car does start to sleep the app can see that and not wake it up. The downside is if you do something interesting while TeslaFi has suspended data collection it won't be logged until TeslaFi resumes collection.