I am using Sharepoint online and have lots of data in it.So after 30 days will I get grace period if I don't want to buy license or I will have to create new account?
Exactly this way. The demo is for testing purpose only. But you can choose if you want to have licences for 12 months (which is a little bit cheaper) or for 1 month only. In doubt call your next CSP who can tell you the right price.