I`m from Sweden but not from Gotland, I think you can definitely fill the time there. Visby is a cosy and beautiful town with lots of shops, cafés, bars and restaurants. Dont forget to walk around the ringwall or "Ringmuren" in swedish. it´s about 3.5 kilometers around and it was built in the 12th century, also the botanical garden is pretty nice to stroll through.
And if you want a meal with a view I can recommend restaurant Krönet, you cant book a table though and it can be quite full in july.
Maybe you can get more ideas from here: https://gotland.com/en/visit/articles-guides/visby-4-hours/