Here is one rule of thumb: You should be sufficiently confident with the topic to be able to guide your student to success.
This means in particular that you should know the topic in which the student is supposed to work in well enough such that:
- You are certain that the workload is manageable in the time outlined by the examination regulations.
- You know that there is enough low hanging fruit in the topic such that it is clear that even a mediocre student should be able to write a thesis that is good enough for the standards of your field and school.
- There are some types of results that a student may obtain during the thesis work that would suffice for the student to write a great thesis, possibly leading to a subsequent publication (given interest by the student).
- You think that you can advise the student with the problems that you expect to occur in the scope of the project.
- You have sufficient time to actually advise the student and in particular have the time to read into the details of the subject in case the student needs some guidance on them.
Depending on the field, it is debatable whether it is OK to hand out topics of which the advisor has comparably little knowledge, given that all requirements from the list above are fulfilled.
Also, the list above focuses on the minimum requirements. Again, it is debatable whether satisfying all points on the list is enough already (unless I forgot something important).
As far as coming up with new thesis topics is concerned: probably everyone has their own approach for this. One way is to collect the ideas that you have in your own research into idea lists, and after some time filtering them by the criteria above.