I have seen examples on mobile where you have a toggle button to let users switch between grid and list views. For a desktop does it make sense to allow users to take this decision?
I agree with @MichaelLai's answer. I just wanted to add some info.
Between lists & grid lists, the decision to use one or the other is not device dependant but content dependant. If the elements contain different information that could be displayed in a list and a grid list (not the same information in a different way, but different information) then include the button to switch between list & grid/card list (independently of the device).
If more than three lines of text need to be shown in list tiles, use cards instead.
If the primary distinguishing content consists of images, use a grid list.
A grid list is best suited to presenting homogenous data, typically images, and is optimized for visual comprehension and differentiating between similar data types.
The way a list and grid view have been developed is to suit the display of different types of content (and therefore usage/purpose). So in a way it is not so much about allowing the user to decide between a list or grid view as it is about what is the optimal view for displaying certain types of information or performing specific operations.
Broadly speaking, a list view is ideal for making comparisons, especially when the list has been organized or sorted in a particular way (much the same as you can with a table). A list is easier to manage compared to a table when the information is more complex in nature (e.g. an aggregate of different types of information or if it is nested). You'll find that in a grid layout sorting makes very little sense because the content has been arranged along two different direction, plus it is more restrictive in terms of the width and height available per grid unit. Hence a grid works better for a smaller number of items, or if you are looking for visual information across a large set of items and there is a distinct visual cue you are trying to identify.
For example, if I was looking for a file that was last modified at a specific time, it makes sense to use a list or table view where I can compare the timestamp on the files. This would be the quickest way to filter through all the content and identify the exact file you want to locate (if it is there). On the other hand, if you want to find an image of a house among a pile of images in a folder, it makes sense to arrange the content in a grid view so that you can scan for the image matching the type of house you are looking for.
So if you can match the type of content with the intent of the user, then you can create the view that best suits the use case. However, if the application has a diverse range of content and that there is no single defined way of using the content then it makes more sense to leave the choice of a grid or list view to the user, as in the case with file browser applications.
Grid view is great for visual objects while list view is great for data driven objects.
Which type of view to use depends on the type of objects that are to be displayed. As designer/developer you can make an executive decision on what would work best in your scenario, but there are instances where it's better for the user to decide. This also applies for desktop.
Let's say you have a webshop selling phone cases.
Some people might want to browse based on the looks. A grid view would work better for them.
Others might be more focused on specific attributes, like shock absorbent (which is often mentioned in the title). A list view would work better for them.
In this case, a view switch is justified for desktop.
Part of the answer is psychological and has to do with identification theory: Different people process information in different ways.
While I personally hate grid views with a passion because I cannot ever find anything, some of my colleagues just have their eyes glaze over when confronted with a dense list.
Giving the option, depending on development time, will likely make for the clearest communication to the greatest number of people.