Where is there a good online source where you can check how often a word appears in Tanach?
You're looking for a Concordance. According to Wikipedia, The first Hebrew concordance was the work of Isaac Nathan ben Kalonymus, begun in 1438 and finished in 1448. It was inspired by the Latin concordances to aid in defence of Judaism, and was printed in Venice in 1523.
I once came across the TanakhML project, which has a Concordance that can be searched by typing in the words you're looking for. The interface is not the most intuitive, and took a little while to figure out what was going on. Also, they use the King James Version for the English Translation, which made me uncomfortable.
There is an online version of the Westminster Leningrad Codex, and it is even searchable, but the search was super slow and resource intensive when I tried to use it. You can download the site and run it off your local computer, which I haven't tried. That might speed things up.
UPDATE: I just came across this website: http://sparks.simania.co.il, which offers a good quick search for words appearing in the Tanach. There are even ways to limit or expand the search results. I don't know how accurate it is, but I did a search for "פְּלִשְׁתִּים" and got 180 results.
Expanding on @Shalom's suggestion of Mechon Mamre, there are a few ways you can go about using it to find what you're looking for.
Mechon Mamare's advanced search contains many options, including stemming (make sure to verify their stemming decisions on the results page). If you are looking for a word-count, make sure to change the dropdown to תנ"ך עברי-אנגלי. You can search in Hebrew or in English*. The results page will show how many results there are as well as links to all of them
If you have a favorite text editor or have some linux command line skills, you can download the full hebrew Tanach from Mechon Mamre and use those.
Lastly, if there is enough demand for it, I'd be glad to throw together a quick website that would allow for some search and count functionality of that Mechon Mamre text. Leave a comment if you're interested. In my free time (read: it might take a while).
*of note, I am getting different results when I search in Hebrew or English. Further investigation is required.
A source, but one with definite drawbacks, is any of the various online copies of Strong's Concordance. It lists words only by root, not by actual word, and its idea of what root a certain word has is not always agreed to by traditional Jewish grammarians.
Sefaria.org's search software is much better now. You can just type in the root of the word, and it will pull from all sorts of sefarim wherever any form of that root appears. For what you're looking for, though, you'll want to go to filters and make sure just Tanach is checked.
Bar Ilan and other Torah software allow for text and gematria searches. They also have free limited web access or full paid access. You can look at it here:
Just like Google made searching easy with a simple input screen,the BEST site for such queries is the simple site http://toraware.com ! It's easy to navigate. There are only 3 "pages", a Home page, an Options page and a Result page. There are 11 search methods. Because each search method has its own set of options, each search method is powerful in its own right. You can search the entire range or limit it to your preference. In case you do not find a method you're looking for, the author may customize one for you. The author keeps his developmental progress posted at this blog: http://torawaredotcom.blogspot.com
The following free websites do concordance searches (in Hebrew):
I don't know how accurate they are; I generally use Bar Ilan Responsa (link in @Ariel K's answer) or the Even Shoshan Concordance (book, Amazon link.)
and copy in english or hebrew words in the search box. You can then count the results or actually visit each sentence in situ.