You cannot know everything, so it depends on what possible attack vectors your code has and what the risks are.
Ask yourself:
this list is not complete but should cover the most common use cases for simple web applications and their security threats
Regarding risk:
As soon as you handle sensible personal data of users or host the site on your own virtual server, you have additional responsibilities because the worst case is not anymore just that your site could be broken, but private data could be exposed, your server could transform into a spambot or worse.
The most important rule is: DON'T TRUST ANY INCOMING DATA
An extension to this rule, important for beginners: Use exactly the measures that fit the current context. DO NOT JUST THROW EVERYTHING AT THE USER INPUT THAT YOU KNOW AND HOPE IT WILL BE MORE SECURE, this is counterproductive! I often see questions like: "Is my application secure if I use addslashes(mysql_real_escape_string(strip_tags(htmlspecialchars())))
on all my $_POST variables?" - if you even consider this a valid approach, you have a serious misunderstanding of how security regarding user input works. I repeat: what's secure and what not, always depends on the context!
A great resource to learn from is the Open Web Application Security Project