If you just want to visit the town, then 1 day is enough for exploring Sonamarg. However, if you would like to explore the valley and lakes, then you will need a few days to trek to all the places.