What is the purpose of this directory?
The purpose of this folder is to store data created by apps that you run. A lot of people think apps in Windows store their settings in Windows Registry. They are wrong. Most apps in Windows store their settings here.
Is it okay to delete the files and directories under it, or not?
Doing that does not make your computer go up in smoke. But you will lose precious things likes some of the shortcuts in your Start menu, Microsoft Office templates and Quick Parts, saved games, playlists, indexes, digital certificates, torrents, incomplete downloads, backups, saved passwords, browser profiles, caches and other settings and configurations that you have spent time adjusting to your needs. Some apps will behave as if they are installed just now. You won't be able to play some of your music and videos protected by DRM.
I know I wouldn't want this to happen to my computer.
But clean it up once in a while. You may have had certain apps in the past that are now gone, but their settings are left there.
Just a note: Mine is 7.47 GB. 7 GB of it is occupied by iTunes's backups of my iPhone devices.