The short answer is yes, most likely you are supposed to pay this. With the exception of people working here on a very limited number of nonimmigrant visa types (F-1 student and a few others), most people working here on nonimmigrant visas are considered Resident Aliens and are subject to these withholding taxes. The first link below provides at least some of the background on this. Also, it provides info on how to reclaim taxes withheld if you were entitled to get them back, as we'll discuss next.
In some cases, the U.S. has agreements in place with other countries to ensure that you aren't double-taxed. You don't say what your home country is, but I include another link below which goes to a page on the Social Security Administration site - this page will guide you to pages on the 22 treaties in place with other nations, info on the terms of these agreements, etc.