Generally, if you don't want to pull a permit, you can change a windows height but not its width
This is because of how the wood around it is framed to provide support to the wall above
It depends on how the home was constructed. With stick frames the window frame is built to take the load from the studs above it and direct it around the window and to the studs below. It can be done but it is not an easy job. Going smaller is easy though. Just build a smaller frame inside the existing one.