1. Sleep at least for 7-8 hours a day.

2. Sleep at least 7-8 hours a day.
(Are they correct? Can we delet 'for'?)

3. Don't write on the book.
4. Don't write in the book.
(Are both OK? What is the difference?)

1 and 2 -- Yes both are correct, but 2 is more often used.

3 means not to write on the OUTSIDE of the book.
4 means not to write on the pages INSIDE the book.