Howdy is a slang greeting, used wherever "Hello" is appropriate. It is the shortened form of How do you do?, which in some dialects of English became "Howdy-doo," and then just plain "Howdy." This greeting is prevalent in the American South, and is stereotypically associated with Texas and Texans.
In usage, it is uttered and written as a statement despite its origins as an interrogative. This is one of the clearest ways to discern whether you are in an area where "Howdy" is used frequently: when you greet someone with a "howdy," they will either answer your greeting with "Fine, thanks," or a similar answer. An answer of "Hi" or "Hello" at least lets you know that you've been understood, but that you're not speaking to a southerner.
A word of warning: be aware that using this greeting marks you as Southern, or at least affiliates you in the minds of others with rural Americans. That is a mark of pride in some places, and of ridicule in others.