If you’re new to GameMaker: Studio and are looking to learn the fundamentals, then I suggest Practical GameMaker Studio Language Projects as a starting point. With this book you’ll learn the basics of GML programming, broken down into bite size sections. Each section has an introduction, explanation of code with worksheets and assignments to test your new knowledge. Also has an end book exam and projects – great for classroom use. Includes a download of all resources & project files.
If you already have some knowledge of using GameMaker: Studio and GML, I have an awesome book 100 Programming Challenges that will push your skills to their limit. Each challenge has an example GMZ file showing an example solution, plus extra tasks for the more advanced GML programmer.