The key is not just that you spend time on a problem - it is normal to struggle with problems at the level you have described - but that you do so in a productive way. In fact, the notion of productive struggle is present in the literature on Mathematics Education; see, for example, my earlier MESE response here.
An interesting source to consult is the Schoenfeld article "What's All the Fuss About Metacognition?" available on google books here. Unfortunately, the images are not present in the link given; below is a particular diagram from the article, Stages. time spent on each stage, sequencing, and management activity in the Expert Group (of Problem Solvers), and the text corresponding to it:

The point I wish to draw your attention to is the second feature discussed above. Namely, that expert problem solvers ask themselves questions about their own thinking while struggling with a problem. This metacognitive feature (metacognition, by the way, refers roughly to thinking about thinking) is often enough to distinguish expert and novice problem solvers.
If these ideas are interesting to you more generally, then I suggest looking up Schoenfeld's (1985) Mathematical Problem Solving. The area that you are asking about would be found under the discussion of control, though the sense that 30 minutes is enough time to spend on a single problem would be quite relevant to his discussion of beliefs and belief systems.
You can find a bit more discussion around these sources in an earlier MO response of mine here.
Summary: If you are looking for an actual number of minutes that you should spend on an individual problem, then I cannot answer this in any sort of generality. Instead, I suggest engaging with the problem as long as you can carry out an idea or recognize an idea is not working and then try to think up a new approach. (In the Mathematics Education literature, sometimes a problem is distinguished from an exercise by defining the former as: a question for which the method of solution is unknown at the outset.) Sometimes a single sitting is not the best way to do this; instead, you might walk away from the problem and come back later when you are ready to try some new method. There is a literature on this idea of taking a break from a problem that you are trying to solve (Wallas (1926) calls this the incubation period) and much more to say in this direction, but let me conclude my response here at the risk of going off too far on a tangent.