Yes, absolutely. That's the most usual way for someone from the USA to refer to their country : either 'I'm from the States' or 'I'm from the US'. It's 100% clear what this means.
In fact, 'I'm from the States' is preferable to 'I'm from America'. Although many people refer informally to the US as 'America', this is - strictly speaking - inaccurate. 'America' is the name of two large continents which contain many more countries than just the US.
The only time someone might want to avoid saying 'the States' is when they are speaking to a non-native who doesn't have a good understanding of English. A person with limited English skills may not know the word 'States', and they may be confused when they hear this. In this situation, it may be necessary to spell it out a bit more and say 'U.S.A' or 'America', as these words will be more easily recognised by someone who doesn't know English well. In all other situations, 'I'm from the States' is fine.