Hi,
In your application, you can manage access rights and privileges by setting up user roles and access rules on entities. With user roles, you can control access to pages and microflows in your application. Access rules on entities will control which user roles can read/write the entities.
In you scenario, you will need to configure two user roles teacher and students.
Please see documentation for details. There is also a full learning path about security
https://docs.mendix.com/refguide/security
https://docs.mendix.com/howto/security/create-a-secure-app
https://academy.mendix.com/link/path/9/Configure-Advanced-Security